Lotto
Megasoft company has organized a TV quiz where a natural number is displayed on the scoreboard. Participants must append one or more digits to the right of this number to create a prime number. They then send this new number via SMS to the studio. The participant who sends their number first wins that amount. However, Gill Bates, the owner of Megasoft, has secretly altered the rules. Now, the prize will be awarded to the participant who first submits the smallest possible number. Your task is to help Gill Bates determine the prize amount according to these new rules.
Input
The program reads a natural number from the keyboard, which will not exceed 1000000.
Output
The program should output the smallest number that can be formed according to the updated quiz rules, which is the amount Gill Bates will have to pay.