165987 in words is written as :

Thousand Nine Hundred and Eighty Seven