The number 38871 (thirty-eight thousand eight hundred seventy-one) is written in Roman numerals as follows: XXXVIIIDCCCLXXI