Reaction of a carbonyl compound with one of the following reagents involves nucleophilic addition followed by elimination of water. The reagent is [2015]
(1)
Carbonyl compounds react with ammonia derivatives in weakly acidic medium as follows:

Here, Z is hydrazine.