Investigations on the thermal and photochemical cyclization of some azahexatrienes: synthesis of fused quinolines