When ammonia $\left( NH _{3}\right)$ reacts with formaldehyde $(HCHO)$, hexamethylenetetramine which is also known as urotropine, is formed. Urotropine is used as a medicine to treat urinary infections.
$\underset{\text{formaldehyde}}{6 HCHO} +\underset{\text{ammonia}}{4 NH _{3}} \longrightarrow \underset{\text{urotropine}}{( CH _{2})_{6} N _{4}}+6 H _{2} O$