Cyclization of ylidenemalononitriles. VI Studies on nitrogen and oxygen heterocyclic systems