The condensation of pyridine-4-carbaldehyde (I) with 4-(methylsulfinyl)acetophenone (II) by means of diethylamine in pyridine gives the chalcone (III), which is treated with 4-fluorobenzaldehyde (IV) and NaCN in DMF to afford the butanedione (V). Finally, this compound is cyclized with ammonium acetate in refluxing acetic acid.