Synthesis of pyrazolo[3,4-d]pyrimidines by intramolecular cycloaddition of azahexatrienes