Synthesis of some new pyrazole and pyrazolopyrimidine derivatives