Three-component cyclocondensation of primary aliphatic amines and amino derivatives of maleopimaric acid methyl ester with formaldehyde and carbochain (1,2-ethane-, 1,3-propane-, 1,4-butane-, 1,5-pentane-, 1,6-hexanedithiols) α,ω-dithiols or 3,6-dioxa-1,8-octanedithiol produced N-substituted thiazacycloalkanes.