Heterocyclic compounds containing 1,4-diazine or hydrogenated 1,4-diazine rings not condensed with other rings having one or two double bonds between ring members or between ring members and non-ring members