Task
School starts on Monday, and as a diligent student, you want to impress your classmates with the things you've learned during the vacation by being active on RoAlgo, to convince them to be active on the server as well. Today, after a successful round on Olympforces, you want to show your classmates one of the problems that appeared there.
You are given a number , and the only thing you need to do is to display the smallest number with digits that has the property that none of its prefixes is a divisor of the displayed number. We don't consider the entire number as a prefix.
For example, if , does not satisfy the required property because is a divisor of . Also, is not a valid answer because it has digits, not as required by the problem.
A valid example is , as is not a multiple of either or , however it is not the smallest such -digit number.
Our hero solved the problem in 2 minutes; now it's your turn to show that he’s not the only one who can do it.
Input data
The first line will contain the integer , the length of the required number.
Output data
The first line will contain a single integer, the required result.
Constraints and clarifications
- ;
- For tests worth points, .
- For tests worth an additional points, .
Example
stdin
2
stdout
21