Aminolysis of N-acyllactams