The reaction of cyanothioacetamide with diethyl ethoxymethylenemalonate in the presence of triethylamine in hot EtOH proceeds non-selectively and leads to the formation of a mixture of triethylammonium 1,5-diamino-2,4-dicyano-5-thioxopenta-1,3-diene-1-thiolate (minor) and triethylammonium 3-cyano-5-ethoxycarbonyl-6-oxo-1Н-pyridine-2-thiolate (major). Upon treatment with primary amines and 37% aqueous HCHO in boiling aqueous ethanol, the reaction product affords only 4-(1,3,5-thiadiazinan-2-ylidene)-2-(3,4-dihydro-2H-1,3,5-thiadiazin- 6-yl)pent-2-enedinitrile derivatives, instead of the expected pyrido[2,1-b][1,3,5]thiadiazines. Triethylammonium 3-cyano-5-ethoxycarbonyl-6-oxo-1Н-pyridine-2-thiolate does not react under these conditions. The structure of the resulted products was confirmed by means of NMR, IR spectroscopy, and LCMS. The mechanism of the formation of the products is discussed.