What is the reaction between diethyl malonate and hydrazine?

For the reaction of diethyl malonate with $\ce{NH2NH2}$ in aqueous medium in presence of $\ce{CH3CH2OH}$, I found two types of product with [SciFinder](https://scifinder.cas.org):


[![Source:Scifinder](https://i.stack.imgur.com/ZlbHx.png)](https://i.stack.imgur.com/ZlbHx.png)


In presence of $\ce{H2SO4}$, the reaction changes to:


[![Source:Scifinder](https://i.stack.imgur.com/tCOt6.png)](https://i.stack.imgur.com/tCOt6.png)


$\ce{EtOH}$ is a good leaving group, but can you explain why there are two different types of products? With what mechanism can they be explained?


