antidivizibil

Time limit: 0.1s Memory limit: 4MB Input: Output:

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 nn, and the only thing you need to do is to display the smallest number with nn 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 n=3n = 3, x=321x = 321 does not satisfy the required property because 33 is a divisor of 321321. Also, 2929 is not a valid answer because it has 22 digits, not 33 as required by the problem.

A valid example is 951951, as 951951 is not a multiple of either 99 or 9595, however it is not the smallest such 33-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 nn, the length of the required number.

Output data

The first line will contain a single integer, the required result.

Constraints and clarifications

  • 2n1002 \leq n \leq 100;
  • For tests worth 3030 points, n9n \leq 9.
  • For tests worth an additional 2020 points, n18n \leq 18.

Example

stdin

2

stdout

21

Log in or sign up to be able to send submissions!