Interaction of M3+ lanthanide cations with amide, urea, thioamide and thiourea ligands: a quantum mechanical study