A Convenient Synthesis of Thiophene, 1,3-Thiazole,2,3-Dihydro-1,3,4-thiadiazole and Pyrazole Derivatives