What are the structures of $X, Y$ and $Z$ in the following reaction sequence?

What are the structures of $X, Y$ and $Z$ in the following reaction sequence?




Asked in: AP EAMCET 2018 (23 Apr Shift 2)

Practice more Amines questions on Aicharya