If X is a sulfur atom or a nitrogen atom substituted by R13, it is also possible firstly to prepare a compound of the formula ##STR12## in which R'1, R'2, Z, p and q are as defined above, and to perform a nucleophilic substitution with a hydrogen sulfide salt or an amine of the formula H2 NR13, in a solvent such as an alcohol, an ether, DMF or a mixture thereof, at a temperature between 5??? C. an