The 3-ylidenepiperazine-2, 5-diones 16 and 39 and 5-acyloxy-2 (1 H)-pyrazinones 17 can serve as starting materials for the Diels-Alder reactions of alkenes and alkynes to the piperazine ring, under acidic conditions or in the presence of acetyl chloride, to afford