Semicarbazones and thiosemicarbazones of the heterocyclic series