Marc wrote down a 5 digit number on a piece of paper. The number when rounded off to the nearest thousand was 12 000. What was the greatest possible number that he wrote?