The number 40718 (forty thousand seven hundred eighteen) is written in Roman numerals as follows: XLDCCXVIII