Selective N-protection of medium-ring triamines