The stereochemical course of ester-amide interchange leading to optically active phosphinic and sulfinic amides