19871 in words is written as :

Nineteen Thousand Eight Hundred and Seventy One