Application of the Thorpe—Ziegler reaction for the synthesis of functionalized thiophenes, thienopyrimidines, and thienotriazines