CF2035B.Everyone Loves Tres

传统题 时间 2000 ms 内存 256 MiB 4 尝试 1 已通过 1 标签

Everyone Loves Tres

There are 3 heroes and 3 villains, so 6 people in total.

Given a positive integer nn. Find the smallest integer whose decimal representation has length nn and consists only of 33s and 66s such that it is divisible by both 3333 and 6666. If no such integer exists, print 1-1.

Input

The first line contains a single integer tt (1t5001\le t\le 500) — the number of test cases.

The only line of each test case contains a single integer nn (1n5001\le n\le 500) — the length of the decimal representation.

Output

For each test case, output the smallest required integer if such an integer exists and 1-1 otherwise.

Note

For n=1n=1, no such integer exists as neither 33 nor 66 is divisible by 3333.

For n=2n=2, 6666 consists only of 66s and it is divisible by both 3333 and 6666.

For n=3n=3, no such integer exists. Only 363363 is divisible by 3333, but it is not divisible by 6666.

For n=4n=4, 33663366 and 66666666 are divisible by both 3333 and 6666, and 33663366 is the smallest.

Samples

6
1
2
3
4
5
7
-1
66
-1
3366
36366
3336366

在线编程 IDE

建议全屏模式获得最佳体验