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