40887 in words is written as :

Forty Thousand Eight Hundred and Eighty Seven