Nitrogen-containing acetals and ketals in the synthesis of pyrrolidine derivatives