Synthesis of new thienotriazolopyrimidine and thienopyrimidotetrazine derivatives from bifuctional intermediates