pls resolve the time limit exceeded…the logic probably is fine for numbers having no. of digit <300
==== question =====
Mr. Erato loves number theory and the uniqueness of prime numbers. One of his Students Eric Failed his tests because of Plagiarism and came to him to plead for help!
Mr. Erato gave a task to his student Eric who failed to find a number that is divisible by all the single-digit prime numbers to pass his course. Eric laughed and said this is so easy to which grinningly Erato replied “Not so easy Chap! The condition to finding the number is that it should be an n digit number and it should be the smallest out of them.” Help Eric to figure out the solution to this problem so that Erato is proud of him and he passes his Math exam.
Note: 0023, 0210 are not valid 4 digit numbers.
Input
A single input line contains a single integer n (1 ≤ n ≤ 10^5)
Output
Print -1 if the required number doesn’t exist. If it exists then output it as a single number.
Examples
input
5
output
10080
input
1
output
-1