Solution (source code)

= Solution

\b[The product is <1,3,4-Oxadiazole>.] Protonation or phosphorylation activates one formyl carbonyl of the diacylhydrazine. The oxygen of the other carbonyl attacks intramolecularly, closing a five-membered ring containing the atom sequence O–C–N–N–C. Proton transfers and loss of water produce the conjugated ring; deprotonation restores the neutral aromatic heterocycle.

The overall transformation is $\mathrm{C_2H_4N_2O_2\to C_2H_2N_2O+H_2O}$. Polyphosphoric acid provides carbonyl activation and an acidic medium. P$_4$O$_{10}$ acts as a strong dehydrating agent, consuming water and maintaining the condensation-driving environment. Neither nitrogen is expelled, and the oxygen retained in the heterocycle originates from a carbonyl rather than an inserted reagent oxygen.