The present invention provides a process for producing a compound of the formula (1) wherein X represents a hydrogen atom, etc., and Y represents a hydrogen atom, etc., which comprises step 1 of reacting a compound of the formula (2) and a compound of the formula (3) in the presence of a Lewis acid wherein R represents a hydrogen atom, etc., to obtain an adduct, and step 2 of reacting the adduct obtained in the step 1 and hydrazine to obtain the compound of the formula (1).