Synthesis of bicyclic imidazole, 1,2,4-triazole and 1,3,5-triazine derivatives from N-cyanolactam 2-imines