Heterocyclic compounds containing 1,4-diazine or hydrogenated 1,4-diazine rings condensed with carbocyclic rings or ring systems