Pyrrolizine and indolizine derivatives from 1,6-dioxo-2,4-diene by inter- and intramolecular ring closure