Magnetic structures of CeMg3, NdMg3 and CeInAg2