The number 12871 (twelve thousand eight hundred seventy-one) is written in Roman numerals as follows: XIIDCCCLXXI