The magnetic structures of LaTiO3 and CeTiO3