Chilly Willy loves playing with numbers. He only knows prime numbers that are digits yet. These numbers are 2, 3, 5 and 7. But Willy grew rather bored of such numbers, so he came up with a few games that were connected with them.

Chilly Willy wants to find the minimum number of length n, such that it is simultaneously divisible by all numbers Willy already knows (2, 3, 5 and 7). Help him with that.

A number's length is the number of digits in its decimal representation without leading zeros.


-----Input-----

A single input line contains a single integer n (1 ≤ n ≤ 10^5).


-----Output-----

Print a single integer — the answer to the problem without leading zeroes, or "-1" (without the quotes), if the number that meet the problem condition does not exist.


-----Examples-----
Input
1

Output
-1

Input
5

Output
10080

Difficulty: interview

Starter code:

Solutions:
import re
import itertools
from collections import Counter

class Task:
    n = 0
    answer = ""
	
    def getData(self):
        self.n = int(input())
	
    def solve(self):
        n = self.n
        if n < 3:
            self.answer = "-1"
            return
        if n == 3:
            self.answer = "210"
            return
        tenRemainders = [1, 3, 2, 6, 4, 5]
        for x in range(0, 100):
            if (tenRemainders[(n - 1) % 6] + x * 10) % 7 == 0 and \
                    (1 + x // 10 + x % 10) % 3 == 0:
                self.answer = '1' + '0' * (n - 4)
                self.answer += '0' + str(x) if (x < 10) else str(x)
                self.answer += '0'
                return

    def printAnswer(self):
        print(self.answer)

task = Task();
task.getData();
task.solve();
task.printAnswer();


n=int(input())
k=True
if(n<3):
    print(-1)
    k=False
if(k):
    x=10**(n-1)

    while(x%210!=0):
        x+=1

    print(x)


n=int(input())-1
if n<2:print(-1)
else:
    z=10**n
    print(210+z-z%210)


n = int(input())
b = 2*3*5*7

a = b * (10**(n - 1) // b + 1)

if a >= 10**n:
    print(-1)
else:
    print(a)

#Dasmesh Singh
import math
n=int(input())
s=0
if n<3:
    print (-1)
elif n==3:
    print (210)
else:
    s=10**(n-1)
    while 1:
        if s%2==0 and s%3==0 and s%5==0 and s%7==0:
            print (s)
            break
        else:
            s+=1

n = int(input()) - 1
k = 10 ** n
m = 210 - k % 210
print(k + m if m < 9 * k else -1)

n = int(input()) - 1
print(10 ** n + 210 - 10 * pow(10, n - 1, 21) if n > 1 else -1)

n = int(input()) - 1
if n < 2: print(-1)
elif n == 2: print(210)
else:
    k = str(210 - 10 * pow(10, n - 1, 21))
    print('1' + '0' * (n - len(k)) + k)

NumLength = int(input())
tens = 100

if NumLength <= 2:
    print("-1")
elif NumLength == 3:
    print("210")
else:
    tens = tens * pow(10, (NumLength - 3))
    tens = tens + 210 - (tens % 210)
    print(tens)

n = int(input())
if n < 3:
	print(-1)
elif n == 3:
	print(210)
else:
	x = 7-[1, 3, 2, 6, 4, 5][(n-1)%6]
	if x%2 == 1:
		x += 7
	while (x+1)%3 != 0 or x%5 != 0:
		x += 14
	print(10**(n-1)+x)


n=int(input())
if n==1 or n==2:
    print(-1)
elif n==3:
    print(210)
else:
    a=(10**(n-1))
    if a%210==0:
        print(a)
    else:
        print(((a//210)+1)*210)
    


n = int(input())
print(-1 if n < 3 else 10 ** (n - 1) // 210 * 210 + 210)


x=int(input())
if x in [1,2]:
   print(-1)
elif x==3:
   print(210)
else:
   print('1'+'0'*(x-4+3-len(str(210-pow(10,x-1,210))))+str(210-pow(10,x-1,210)))


n=int(input())
if n<3:
    print(-1)
else:
    print(10**(n-1) + 210 - (10**(n-1))%210)


n = int(input())

if (n < 3):
    print(-1)
    return

cur = 10 ** (n - 1)

ans = 2 * 3 * 5 * 7

nex = cur//ans

print(ans * (nex + 1))


from fractions import gcd
from random import randint


def __starting_point():
    n = int(input())
    if n < 3:
        print(-1)
        return
    res = (210 -(10**(n-1) % 210)) + 10**(n-1);
    print(res)
__starting_point()

n = int(input())
if n < 3:
    print(-1)
else:
    t = 10**(n-1)
    print(t+(210-t%210))


n = int(input())
if n < 3:
    print(-1)
else:
    t = 10**(n-1)
    print(t+210-t%210)


n=int(input())

if n<3:
    print(-1)
else:
    k=int(pow(10,n-1))
    l=k+210-(k%210)
    print(l)


n = int(input());
ti = 1;

if(n<=2):
    print(-1);
    return;

n-=2;
ti = 10**n;

if(ti%21):
    ti//=21;
    ti+=1;
    ti*=21;
ti*=10;
print(ti);

n = int(input())
if n<3: print(-1)
else:
	x=int('1'+'0'*(n-1))
	x=x+(210-x%210)
	print(x)

n = int(input())
if n < 3:
	print(-1)
else :
	print(((10**(n-1)-1)//210 + 1)*210)

'''input
3
'''
n = int(input())
if n < 3:
	print(-1)
else:
	print(((10**(n-1))//210+1)*210)

'''input
99988
'''
n = int(input())
if n < 3:
	print(-1)
else:
	print(((10**(n-1))//210+1)*210)