You are given a integer $n$ ($n > 0$). Find any integer $s$ which satisfies these conditions, or report that there are no such numbers:

In the decimal representation of $s$:   $s > 0$,  $s$ consists of $n$ digits,  no digit in $s$ equals $0$,  $s$ is not divisible by any of it's digits. 


-----Input-----

The input consists of multiple test cases. The first line of the input contains a single integer $t$ ($1 \leq t \leq 400$), the number of test cases. The next $t$ lines each describe a test case.

Each test case contains one positive integer $n$ ($1 \leq n \leq 10^5$).

It is guaranteed that the sum of $n$ for all test cases does not exceed $10^5$.


-----Output-----

For each test case, print an integer $s$ which satisfies the conditions described above, or "-1" (without quotes), if no such number exists. If there are multiple possible solutions for $s$, print any solution.


-----Example-----
Input
4
1
2
3
4

Output
-1
57
239
6789



-----Note-----

In the first test case, there are no possible solutions for $s$ consisting of one digit, because any such solution is divisible by itself.

For the second test case, the possible solutions are: $23$, $27$, $29$, $34$, $37$, $38$, $43$, $46$, $47$, $49$, $53$, $54$, $56$, $57$, $58$, $59$, $67$, $68$, $69$, $73$, $74$, $76$, $78$, $79$, $83$, $86$, $87$, $89$, $94$, $97$, and $98$.

For the third test case, one possible solution is $239$ because $239$ is not divisible by $2$, $3$ or $9$ and has three digits (none of which equals zero).

Difficulty: EASY
Tags: Number theory

Constructive algorithms

Starter code:

Solutions:
t = int(input())
for i in range(t):
	n = int(input())
	if n == 1:
		print(-1)
	else:
		print('2' + '3' * (n - 1))


for _ in range(int(input())):
	N = int(input())
	if N == 1:
		print(-1)
		continue
	else:
		print('2' + '3' * (N - 1))


t = int(input())
for _ in range(t):
	n = int(input())
	if n == 1:
		print(-1)
	else:
		s = '2' + '3' * (n - 1)
		print(s)


for i in range(int(input())):
	n = int(input())
	if n == 1:
		print(-1)
	else:
		s = '3' * (n - 1)
		s = s + '4'
		print(s)


import sys
RI = lambda : [int(x) for x in sys.stdin.readline().split()]
rw = lambda : sys.stdin.readline().strip()
for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print(-1)
		continue
	for i in range(n - 1):
		print(3, end='')
	print(4)


import sys

def guess(n):
	if n == 1:
		return '-1'
	return '2' + '3' * (n - 1)
t = int(sys.stdin.readline())
for i in range(t):
	n = int(sys.stdin.readline())
	s = guess(n)
	print(s)


test = int(input())
answer = []
for _ in range(test):
	n = int(input())
	if n == 1:
		answer.append('-1')
	else:
		string = '5' + (n - 1) * '9'
		answer.append(string)
print('\n'.join(answer))


data = input().rstrip().split()
n = int(data[0])
for _ in range(n):
	data = input().rstrip().split()
	a = int(data[0])
	if a == 1:
		print(-1)
		continue
	else:
		s = '2' + '3' * (a - 1)
		print(s)


t = int(input())
for i in range(t):
	n = int(input())
	if n != 1:
		print('7' * (n - 2) + '47')
	else:
		print(-1)


for _ in range(int(input())):
	a = int(input())
	if a == 1:
		print(-1)
	else:
		print('2' + '3' * (a - 1))


for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print(-1)
	elif n == 2:
		print(23)
	else:
		print('23' + '3' * (n - 2))


import math

class Read:

	@staticmethod
	def string():
		return input()

	@staticmethod
	def int():
		return int(input())

	@staticmethod
	def list(sep=' '):
		return input().split(sep)

	@staticmethod
	def list_int(sep=' '):
		return list(map(int, input().split(sep)))

def solve():
	n = Read.int()
	if n == 1:
		print(-1)
		return
	res = ''
	if (n - 1) % 3 != 0:
		for i in range(n - 1):
			res += '2'
	else:
		res = '3'
		for i in range(n - 2):
			res += '2'
	res += '3'
	print(res)
query_count = Read.int()
while query_count:
	query_count -= 1
	solve()


n = int(input())
for j in range(n):
	i = int(input())
	if i == 1:
		print(-1)
	else:
		print('5' * (i - 1) + '8')


t = int(input())
for i in range(t):
	n = int(input())
	if n == 1:
		print(-1)
	elif (n - 1) % 3 != 0:
		print('2' * (n - 1) + '3')
	else:
		print('5' + '3' * (n - 1))


t = int(input())
ans = []
for s in range(t):
	n = int(input())
	if n == 1:
		ans.append(-1)
	elif (n - 1) % 9 != 0:
		ans.append('5' * (n - 1) + '9')
	else:
		ans.append('5' * (n - 2) + '2' + '9')
for it in ans:
	print(it)


import sys
inp = sys.stdin.readline

def input():
	return inp().strip()

def iin():
	return int(input())

def lin():
	return list(map(int, input().split()))

def main():
	T = iin()
	while T:
		T -= 1
		n = iin()
		if n == 1:
			print(-1)
		else:
			ans = ['4'] * 1 + ['3'] * (n - 1)
			print(''.join(ans))
main()


from math import gcd, ceil
from collections import defaultdict as dd

def lcm(a, b):
	return a * b // gcd(a, b)

def inin():
	return int(input())

def inar():
	return list(map(int, input().split()))

def ar(element, size):
	return [element for i in range(size)]

def digitsum(num):
	su = 0
	while num:
		su += num % 10
		num //= 10
	return su

def pred(n, k, pointer):
	return pointer - k >= n

def yes():
	print('YES')

def no():
	print('NO')
for _ in range(inin()):
	n = inin()
	if n == 1:
		print(-1)
	else:
		ans = '5' + '3' * (n - 1)
		print(ans)


for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print(-1)
	else:
		print(2, end='')
		for i in range(n - 1):
			print(3, end='')
		print()


t = int(input())
while t != 0:
	t -= 1
	a = int(input())
	if a == 1:
		print('-1')
	else:
		print('2' + '3' * (a - 1))


t = int(input())
AnsList = []
for _ in range(t):
	n = int(input())
	if n == 1:
		ans = -1
	else:
		ans = int('2' + '3' * (n - 1))
	AnsList.append(ans)
for x in AnsList:
	print(x)


def main():
	t = int(input())
	for tt in range(0, t):
		a = int(input())
		if a == 1:
			print(-1)
			continue
		for i in range(0, a - 2):
			print(2, end='')
		if (a - 1) % 3 == 0:
			print(43)
		else:
			print(23)
	return
main()


t = int(input())
while t > 0:
	t -= 1
	n = int(input())
	if n == 1:
		print('-1')
	else:
		k = (n - 1) * 2
		if k % 3 != 0:
			s = ''
			for i in range(0, n - 1):
				s += '2'
			s += '3'
		else:
			s = ''
			for i in range(0, n - 2):
				s += '2'
			s += '33'
		print(s)


t = int(input())
while t > 0:
	t -= 1
	n = int(input())
	if n == 1:
		print('-1')
	else:
		c = 1
		s = 2 * (n - 1) + 9
		if s % 9 == 0:
			n -= 1
			c += 1
		n -= 2
		print('2', end='')
		while n > 0:
			print('2', end='')
			n -= 1
		while c > 0:
			print('9', end='')
			c -= 1
		print()


for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print(-1)
	elif n == 2:
		print(67)
	else:
		num = n - 2
		s = str(6)
		for i in range(1, num + 1):
			s = s + '2'
		s = s + '7'
		print(s)


t = int(input())
for _ in range(t):
	n = int(input())
	if n == 1:
		print(-1)
	elif (n - 1) % 3 != 0:
		print('2' * (n - 1) + '3')
	else:
		print('2' * (n - 2) + '4' + '3')


from sys import stdin, stdout
stdin.readline()
numbers = map(int, stdin.readlines())
for el in numbers:
	if el == 1:
		stdout.write('-1')
	else:
		stdout.write('9' * (el - 1) + '8')
	stdout.write('\n')


for tin in range(int(input())):
	n = int(input())
	if n == 1:
		print(-1)
	elif int('3' * (n - 1) + '8') % 8 == 0:
		print('3' * (n - 1) + '7')
	else:
		print('3' * (n - 1) + '8')


t = int(input())
for _ in range(t):
	n = int(input())
	if n == 1:
		print('-1')
	else:
		print('2', end='')
		print('9' * (n - 1))


test_cases = int(input())
for test_case in range(test_cases):
	n = int(input())
	if n == 1:
		print(-1)
	else:
		result = '2'
		for i in range(n - 1):
			result += '3'
		print(result)


from sys import stdin, stdout
import math
import heapq
t = 1

def aint():
	return int(input().strip())

def lint():
	return list(map(int, input().split()))

def fint():
	return list(map(int, stdin.readline().split()))

def main():
	n = aint()
	if n == 1:
		print('-1')
	elif ((n - 1) * 5 + 3) % 3 > 0:
		print('5' * (n - 1) + '3')
	else:
		print('5' * (n - 2) + '33')
t = int(input())
for i in range(t):
	main()


import os, sys, bisect, copy
from collections import defaultdict, Counter, deque
from functools import lru_cache
if os.path.exists('in.txt'):
	sys.stdin = open('in.txt', 'r')
if os.path.exists('out.txt'):
	sys.stdout = open('out.txt', 'w')

def input():
	return sys.stdin.readline()

def mapi(arg=0):
	return map(int if arg == 0 else str, input().split())
for _ in range(int(input())):
	n = int(input())
	if n <= 1:
		print(-1)
	else:
		print('2' + '3' * (n - 1))


t = int(input())
for _ in range(t):
	n = int(input())
	if n == 1:
		print(-1)
	else:
		print(pow(10, n) - 2)


import math
for i in range(int(input())):
	n = int(input())
	if n == 1:
		print(-1)
		continue
	s = '9' * (n - 1)
	s += '8'
	print(int(s))


for _ in range(int(input())):
	n = int(input())
	print(['-1', '2' + '3' * (n - 1)][n > 1])


for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print(-1)
		continue
	lola = '4' + '9' * (n - 1)
	print(lola)


for fdsfds in range(int(input())):
	n = int(input())
	count = 0
	if n > 1 and (n - 1) % 3 != 0:
		print('2' * (n - 1) + '3')
	elif n > 1:
		print('2' * (n - 2) + '4' + '3')
	else:
		print('-1')


for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print('-1')
	else:
		res = (n - 2) * '3'
		res += '4'
		t = res + '7'
		if int(t) % 7:
			res = t
			print(res)
		else:
			res += '3'
			print(res)


for i in range(int(input())):
	n = int(input())
	if n == 1:
		print(-1)
		continue
	print('2' + '9' * (n - 1))


t = int(input())
for i in range(t):
	n = int(input())
	twos = n - 1
	threes = 1
	if n != 1:
		while (2 * twos + 3 * threes) % 3 == 0:
			threes += 1
			twos -= 1
		if threes + twos == n:
			print('2' * twos, end='')
			print('3' * threes, end='')
			print('\n')
	else:
		print(-1)


for _ in range(int(input())):
	n = int(input())
	if n - 1:
		r = '2' + '3' * (n - 1)
	else:
		r = -1
	print(r)


import math
for w in range(int(input())):
	a = int(input())
	if a == 1:
		print(-1)
	else:
		b = '3' * (a - 1)
		print('2' + b)


for _ in range(int(input())):
	n = int(input())
	l = [1, 2, 3, 5, 6, 7, 8, 9]
	if n == 1:
		print(-1)
	else:
		g = 0
		for j in range(2, 10):
			string = str(j) * (n - 1)
			num = int(string)
			l = [1, 2, 3, 4, 5, 6, 7, 8, 9]
			for i in l:
				temp = num * 10 + i
				if temp % i != 0 and temp % j != 0:
					print(temp)
					g = 1
					break
			if g == 1:
				break
		if g == 0:
			print(-1)


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
n = int(input())
for i in range(n):
	t = int(input())
	if t == 1:
		print(-1)
	else:
		s = '2' * 1 + '3' * (t - 1)
		print(s)


cases = int(input())
for _ in range(cases):
	n = int(input())
	if n == 1:
		print(-1)
		continue
	elif n == 2:
		print(23)
	else:
		print(str(23) + '9' * (n - 2))


import sys
input = sys.stdin.readline

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())
t = inp()
for i in range(t):
	n = inp()
	if n == 1:
		{print(-1)}
	else:
		print(2, end='')
		for j in range(n - 1):
			print(3, end='')
		print('')


t = int(input())
for _ in range(t):
	n = int(input())
	if n == 1:
		print(-1)
	else:
		s = '5' * (n - 1) + '8'
		print(s)


def solve(n):
	if n == 1:
		return -1
	return int('5' * (n - 1) + '8')
numbers = input()
for i in range(int(numbers)):
	print(solve(int(input())))


import sys
import math
import itertools
import functools
import collections
import operator
import fileinput
import copy
ORDA = 97

def ii():
	return int(input())

def mi():
	return map(int, input().split())

def li():
	return [int(i) for i in input().split()]

def lcm(a, b):
	return abs(a * b) // math.gcd(a, b)

def revn(n):
	return str(n)[::-1]

def dd():
	return collections.defaultdict(int)

def ddl():
	return collections.defaultdict(list)

def sieve(n):
	if n < 2:
		return list()
	prime = [True for _ in range(n + 1)]
	p = 3
	while p * p <= n:
		if prime[p]:
			for i in range(p * 2, n + 1, p):
				prime[i] = False
		p += 2
	r = [2]
	for p in range(3, n + 1, 2):
		if prime[p]:
			r.append(p)
	return r

def divs(n, start=2):
	r = []
	for i in range(start, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n / i == i:
				r.append(i)
			else:
				r.extend([i, n // i])
	return r

def divn(n, primes):
	divs_number = 1
	for i in primes:
		if n == 1:
			return divs_number
		t = 1
		while n % i == 0:
			t += 1
			n //= i
		divs_number *= t

def prime(n):
	if n == 2:
		return True
	if n % 2 == 0 or n <= 1:
		return False
	sqr = int(math.sqrt(n)) + 1
	for d in range(3, sqr, 2):
		if n % d == 0:
			return False
	return True

def convn(number, base):
	new_number = 0
	while number > 0:
		new_number += number % base
		number //= base
	return new_number

def cdiv(n, k):
	return n // k + (n % k != 0)

def ispal(s):
	for i in range(len(s) // 2 + 1):
		if s[i] != s[-i - 1]:
			return False
	return True
for i in range(ii()):
	n = ii()
	if n == 1:
		print(-1)
		continue
	s = '7' * (n - 1)
	print('4' + s)


t = int(input())
while t != 0:
	n = int(input())
	if n == 1:
		print(-1, end='')
	elif ((n - 1) * 2 + 3) % 3 == 0:
		for i in range(n - 2):
			print('2', end='')
		print('4', end='')
		print(3, end='')
	else:
		for i in range(n - 1):
			print('2', end='')
		print(3, end='')
	print()
	t -= 1


for _ in range(int(input())):
	i = int(input())
	flag = 0
	if i == 1:
		print(-1)
	else:
		print('2' + '3' * (i - 1))


t = int(input())
for _ in range(t):
	n = int(input())
	ans = ['2'] * n
	if n == 1:
		print(-1)
	else:
		if 2 * (n - 1) % 3 == 0:
			ans[-2] = '3'
		an = ''.join(ans)
		an = int(an)
		print(an + 1)


from sys import stdin
inp = stdin.readline
for _ in range(int(inp())):
	n = int(inp())
	if n == 1:
		print(-1)
	else:
		s = ['9'] * (n - 1)
		s.append('8')
		s = ''.join(s)
		print(s)


for _ in range(int(input())):
	n = int(input())
	print('3' * (n - 1) + '4' if n != 1 else -1)


for t in range(int(input())):
	n = int(input())
	if n == 1:
		print('-1')
	elif (n - 1) % 9 == 0:
		for i in range(n - 1):
			print('7', end='')
		print('8')
	else:
		for i in range(n - 1):
			print('7', end='')
		print('9')


for _ in [0] * int(input()):
	n = int(input())
	if n > 1:
		print('4' + (n - 1) * '7')
	else:
		print(-1)


for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print(-1)
	elif n == 2:
		print('2', '3', sep='')
	else:
		print('3' * (n - 2), end='')
		print('2', '3', sep='')


from sys import stdin, stdout
import math
from itertools import permutations, combinations
from collections import defaultdict
from bisect import bisect_left
from bisect import bisect_right

def L():
	return list(map(int, input().split()))

def In():
	return map(int, input().split())

def I():
	return int(input())
P = 1000000007

def main():
	for t in range(I()):
		n = I()
		if n == 1:
			print(-1)
		else:
			print('5' * (n - 1) + '4')
main()


t = int(input())
for i in range(t):
	n = int(input())
	out = ''
	if n == 1:
		print(-1)
	else:
		for i in range(n - 1):
			out += '3'
		print(out + '4')


t = int(input())
while t > 0:
	n = int(input())
	if n == 1:
		print('-1')
	else:
		print(2, end='')
		for i in range(0, n - 1):
			print(7, end='')
		print()
	t -= 1


t = int(input())
while t:
	M = int(input())
	print(-1 if M == 1 else (10 ** (M - 1) << 1) + (10 ** (M - 1) - 1) // 9 * 3)
	t -= 1


t = int(input())
for _ in range(t):
	n = int(input())
	if n == 1:
		print(-1)
	else:
		ans = '5' + (n - 1) * '6'
		print(ans)


import sys
t = int(input())
for i in range(0, t):
	n = int(input())
	ans = []
	if n == 1:
		sys.stdout.write(str(-1) + '\n')
		continue
	chk = True
	for j in range(0, n):
		if chk:
			sys.stdout.write(str(2))
			chk = False
		else:
			sys.stdout.write(str(3))
	sys.stdout.write('\n')


from sys import stdin, stdout
import math, sys
from itertools import permutations, combinations
from collections import defaultdict
import bisect
import heapq as hq

def main():
	try:
		for _ in range(int(input())):
			n = int(input())
			t = []
			if n == 1:
				print(-1)
			else:
				for i in range(n):
					t.append('2')
				if (n - 1) % 3 == 0:
					t[-2] = '3'
				t[-1] = '3'
				print(''.join(t))
	except:
		pass
M = 998244353
P = 1000000007
main()


t = int(input())
while t:
	n = int(input())
	if n == 1:
		print(-1)
	else:
		if n % 2 == 0:
			if n % 9 == 0:
				n = int(n / 2) - 1
				s = '59' * n + '58'
			else:
				s = '59' * int(n / 2)
		elif n % 3 == 1 and n >= 7:
			s = '59' * (int(n / 2) - 1) + '58' + '3'
		else:
			n = int(n / 2)
			s = '59' * n + '3'
		print(s)
	t -= 1


t = input()
t = int(t)
while t > 0:
	n = int(input())
	if n == 1:
		print('-1')
	else:
		s = []
		s = [2 for i in range(n)]
		s[n - 1] = 3
		check = n * 2 - 2 + 3
		if check % 3 == 0:
			s[n - 2] = 4
		print(*s, sep='')
	t -= 1


t = int(input())
while t:
	n = int(input())
	if n >= 2:
		print('23', end='')
	else:
		print('-1')
	while n > 2:
		print('3', end='')
		n -= 1
	print(' ')
	t -= 1


t = int(input())
while t > 0:
	t -= 1
	n = int(input())
	if n == 1:
		print(-1)
	else:
		print('2' + '9' * (n - 1))


t = int(input())
for i in range(t):
	n = int(input())
	if n == 1:
		print(-1)
		continue
	answer = int(''.join(['2'] * (n - 1)) + '3')
	if answer % 3 != 0:
		print(answer)
	else:
		print('3' + str(answer)[1:])


test_cases = int(input())
data = []
test = test_cases
while test_cases > 0:
	data.append(input())
	test_cases -= 1
for i in range(0, len(data)):
	number = '2' * (int(data[i]) - 1) + '3'
	if int(data[i]) == 1:
		print(-1)
	elif int(number) % 3 != 0:
		print(number)
	elif int(number) % 3 == 0:
		number = '2' * (int(data[i]) - 2) + '33'
		print(number)


for i in range(int(input())):
	x = int(input())
	if x == 1:
		print(-1)
	else:
		print('2', '3' * (x - 1), sep='')


from collections import defaultdict as dc
from collections import deque as dq
from bisect import bisect_left, bisect_right, insort_left
import sys
import math
from heapq import heapify, heappush, heappop
mod = 10 ** 9 + 7

def rem(p, q):
	z = p // q
	r = p - q * z
	return r

def inp():
	p = int(input())
	return p

def line():
	p = list(map(int, input().split()))
	return p
for i in range(inp()):
	n = inp()
	if n == 1:
		print(-1)
	elif n == 2:
		print(57)
	elif n % 2 == 0:
		s = '5' * (n - 2) + '8' * 2
		print(s)
	else:
		s = '5' * (n - 1) + '8'
		print(s)


n = int(input())
for i in range(n):
	a = int(input())
	if a == 1:
		print('-1')
	else:
		st = ''
		for i in range(a - 1):
			st = st + '7'
		et = '2'
		print(et + st)


for _ in range(int(input())):
	a = int(input())
	if a == 1:
		print(-1)
	else:
		s = '7' * (a - 1)
		s += '9'
		s = int(s)
		if s % 7 or s % 9:
			s -= 1
		print(int(s))


for _ in range(int(input())):
	N = int(input())
	if N == 1:
		print(-1)
	else:
		print('7' * (N - 1) + '4')


t = int(input())
for ti in range(t):
	n = int(input())
	if n == 1:
		print(-1)
	else:
		print('5' + '6' * (n - 1))


t = int(input())
for _ in range(t):
	n = int(input())
	if n == 1:
		print(-1)
	else:
		print('5' + '3' * (n - 1))


t = int(input())
while t > 0:
	n = int(input())
	if n == 1:
		print(-1)
	else:
		l = '2'
		l += '3' * (n - 1)
		print(l)
	t -= 1


import sys
sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep='\n')

def II():
	return int(sys.stdin.readline())

def MI():
	return map(int, sys.stdin.readline().split())

def LI():
	return list(map(int, sys.stdin.readline().split()))

def LLI(rows_number):
	return [LI() for _ in range(rows_number)]

def SI():
	return sys.stdin.readline()[:-1]

def main():
	t = II()
	for _ in range(t):
		n = II()
		if n == 1:
			print(-1)
		elif n % 3 == 1:
			print('2' * (n - 2) + '3' * 2)
		else:
			print('2' * (n - 1) + '3')
main()


import sys
input = sys.stdin.readline

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())
tests = inp()
testcount = 0
while testcount < tests:
	n = inp()
	if n == 1:
		print(-1)
	else:
		print(int('9' * (n - 1) + '8'))
	testcount += 1


from sys import stdin, stdout
from sys import maxsize
input = stdin.readline

def solve():
	pass
test = 1
test = int(input().strip())
for t in range(0, test):
	n = int(input().strip())
	if n == 1:
		print(-1)
	else:
		print(2, end='')
		for i in range(n - 1):
			print(9, end='')
		print()
	ans = solve()


for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print('-1')
		continue
	if (n - 1) % 3 == 0:
		x = '2' * (n - 2) + '3' + '7'
		x = int(x)
		print(x)
	else:
		x = '2' * (n - 1) + '3'
		x = int(x)
		print(x)


import sys
import math
fileoperation = 0
if fileoperation:
	orig_stdout = sys.stdout
	orig_stdin = sys.stdin
	inputfile = open('W:/Competitive Programming/input.txt', 'r')
	outputfile = open('W:/Competitive Programming/output.txt', 'w')
	sys.stdin = inputfile
	sys.stdout = outputfile
mod = 1000000007

def nospace(l):
	ans = ''.join((str(i) for i in l))
	return ans
t = int(input())
for tt in range(t):
	n = int(input())
	if n == 1:
		print(-1)
	else:
		s = '2'
		for i in range(n - 1):
			s += '3'
		print(s)
if fileoperation:
	sys.stdout = orig_stdout
	sys.stdin = orig_stdin
	inputfile.close()
	outputfile.close()


def solve(n):
	if n == 1:
		return '-1'
	else:
		s = '2' * (n - 1) + '7'
		if int(s) % 7 == 0:
			s = s[:-2] + '77'
		return s
answers = []
t = int(input())
for i in range(t):
	n = int(input())
	answers.append(solve(n))
print('\n'.join(answers))


a = int(input())
for i in range(a):
	s = int(input())
	if s == 1:
		print(-1)
	else:
		ans = []
		for i in range(s - 1):
			ans.append(5)
		ans.append(4)
		print(''.join(map(str, ans)))


from sys import stdin, stdout
for i in range(int(stdin.readline())):
	n = int(stdin.readline().strip())
	if n == 1:
		stdout.write('-1\n')
	else:
		s = '5' * (n - 1) + '4'
		stdout.write(s + '\n')


from __future__ import division, print_function
import itertools
import sys
import os
from io import BytesIO, IOBase
if sys.version_info[0] < 3:
	input = raw_input
	range = xrange
	filter = itertools.ifilter
	map = itertools.imap
	zip = itertools.izip

def is_it_local():
	script_dir = str(os.getcwd()).split('/')
	username = 'dipta007'
	return username in script_dir

def READ(fileName):
	if is_it_local():
		sys.stdin = open(f'./{fileName}', 'r')
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def input1(type=int):
	return type(input())

def input2(type=int):
	[a, b] = list(map(type, input().split()))
	return (a, b)

def input3(type=int):
	[a, b, c] = list(map(type, input().split()))
	return (a, b, c)

def input_array(type=int):
	return list(map(type, input().split()))

def input_string():
	s = input()
	return list(s)
if is_it_local():

	def debug(*args):
		st = ''
		for arg in args:
			st += f'{arg} '
		print(st)
else:

	def debug(*args):
		pass

def main():
	t = input1()
	for ci in range(t):
		n = input1()
		if n == 1:
			print(-1)
			continue
		two = n // 3 * 3
		if two == n or two == n - 1:
			two -= 1
		else:
			two += 1
		st = '2'
		print(2, end='')
		for i in range(n - 1):
			print(3, end='')
		print()
	pass
main()


t = int(input())
while t > 0:
	t -= 1
	n = int(input())
	if n == 1:
		print('-1')
		continue
	s = '2'
	for i in range(1, n):
		s += '3'
	print(s)


for i in range(int(input())):
	n = int(input())
	if n == 1:
		print(-1)
	else:
		print(2, end='')
		print('7' * (n - 1), end='')
	print('\n')


t = int(input())
ar = []
for i in range(t):
	n = int(input())
	if n == 1:
		ar.append('-1')
	elif (n - 1) % 3 == 0:
		ar.append('2' * (n - 2) + '33')
	else:
		ar.append('2' * (n - 1) + '3')
for i in ar:
	print(i)


def main():
	t = int(input())
	for _ in range(t):
		n = int(input())
		if n == 1:
			print(-1)
			continue
		k = (n - 1) * 7
		if k % 3 == 0:
			if (k + 8) % 8 == 0:
				print('7' * (n - 2) + '88')
			else:
				print('7' * (n - 1) + '8')
		else:
			print('7' * (n - 1) + '3')
	return
main()


t = int(input())
for i in range(t):
	n = int(input())
	num = str(2)
	if n == 1:
		print(-1)
	else:
		for j in range(n - 1):
			num += str(3)
	if num != '2':
		print(num)


from sys import stdin, stdout
n = int(stdin.readline())
for _ in range(n):
	n = int(stdin.readline())
	if n == 1:
		stdout.write('-1\n')
	else:
		stdout.write('2')
		while n > 1:
			stdout.write('3')
			n -= 1
		stdout.write('\n')


t = int(input())
for p in range(t):
	n = int(input())
	if n == 1:
		print(-1)
	else:
		r = '2'
		for k in range(n - 1):
			r += '3'
		print(int(r))


for i in range(int(input())):
	n = int(input())
	b = '3' * (n - 2)
	if n == 1:
		print(-1)
	elif n == 2:
		print(23)
	else:
		print(int(b + '23'))


T = int(input())
while T:
	n = int(input())
	s = -1
	if n > 1:
		for i in range(1, 9):
			r = 10 ** n - i
			j = 10 - i
			if r % j != 0 and r % 9 != 0:
				s = r
	print(s)
	T = T - 1


for _ in range(int(input())):
	n = int(input())
	b = [0] * n
	if n == 1:
		print(-1)
	else:
		b[0] = 2
		for i in range(1, n):
			b[i] = 3
		c = str(b[0])
		for i in range(1, len(b)):
			c += str(b[i])
		print(c)


t = int(input())
for _ in range(t):
	n = int(input())
	if n == 1:
		print(-1)
	else:
		for _ in range(n - 1):
			print(5, end='')
		if ((n - 1) * 5 + 3) % 3 != 0:
			print(3)
		else:
			print(4)


t = int(input())
for i in range(t):
	n = int(input())
	if n == 1:
		print(-1)
	elif n == 2:
		print('38')
	else:
		print('3', end='')
		if (n - 2) % 3 == 0:
			for j in range(n - 3):
				print('8', end='')
			print('3', end='')
		else:
			for j in range(n - 2):
				print('8', end='')
		print('3')


n = int(input())
a = [0] * n
for i in range(n):
	x = int(input())
	if x == 1:
		a[i] = -1
		continue
	a[i] = 10 ** x - 2
print(*a, sep='\n')


n = int(input())
for i in range(n):
	ans = ''
	x = int(input())
	if x == 1:
		print('-1')
	else:
		while x > 1:
			ans += '3'
			x -= 1
		ans += '4'
		print(ans)


testes = int(input())
for t in range(testes):
	n = int(input())
	str = ''
	if n == 1:
		print(-1)
	else:
		for k in range(n):
			if k != n - 2:
				str += '6'
			else:
				str += '5'
		print(str)


for i in range(int(input())):
	lst = int(input())
	if lst == 1:
		print(-1)
	else:
		print(10 ** lst - 2)


def solve():
	n = int(input())
	if n == 1:
		print(-1)
	elif n == 2:
		print(57)
	elif (n - 1) % 3:
		for i in range(n - 1):
			print(2, end='')
		print(3)
	else:
		for i in range(n - 2):
			print(2, end='')
		print(33)
t = int(input())
for _ in range(t):
	solve()


def solve(n):
	if n == 1:
		return -1
	else:
		return '2' + '3' * (n - 1)
t = int(input())
results = list()
for _ in range(0, t):
	n = int(input())
	results.append(solve(n))
for result in results:
	print(result)


tc = int(input())
import math
for _ in range(tc):
	x = int(input())
	if x == 1:
		print(-1)
	else:
		ans = '2'
		for i in range(x - 1):
			ans += '3'
		print(ans)


t = int(input())
for i in range(t):
	n = int(input())
	if n == 1:
		print(-1)
	else:
		f = (n - 1) * str(2) + str(3)
		s = (n - 2) * str(2) + 2 * str(3)
		if int(f) % 3 != 0:
			print(f)
		else:
			print(s)


for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print(-1)
		continue
	else:
		s = '9' * (n - 1) + '8'
		print(s)


for tc in range(int(input())):
	i = int(input())
	if i == 1:
		print(-1)
		continue
	for j in range(0, i - 2):
		print('2', end='')
	if (i - 1) % 9 == 0:
		print('99')
	else:
		print('29')


k = int(input())
for m in range(k):
	a = int(input())
	if a == 1:
		print(-1)
		continue
	print(2, end='')
	for i in range(a - 1):
		print(3, end='')
	print()


for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print(-1)
	else:
		s = ''
		if (n - 1) % 9 == 0:
			s = '7' + '2' * (n - 2) + '7'
		else:
			s = '2' * (n - 1) + '9'
		print(int(s))


t = int(input())
for _ in range(t):
	n = int(input())
	if n == 1:
		print(-1)
	else:
		nums = ['2']
		for i in range(n - 1):
			nums.append('3')
		print(''.join(nums))


from sys import stdin
cases = int(stdin.readline().strip())
for i in range(cases):
	n = int(stdin.readline().strip())
	if n == 1:
		print('-1')
	else:
		elegido = 10 ** (n - 1) * 2 + int('3' * (n - 1))
		print(elegido)


def calculate(m):
	if m <= 1:
		return -1
	return 9 * (10 ** (m - 1) - 1) + 2
t = int(input())
while t:
	n = int(input())
	print(calculate(n))
	t -= 1


from os import remove
from sys import stdin

def readint():
	return int(stdin.readline())

def readarray(typ):
	return list(map(typ, stdin.readline().split()))

def readmatrix(n):
	M = []
	for _ in range(n):
		row = readarray(int)
		assert len(row) == n
		M.append(row)
	return M

def solve():
	n = readint()
	s = '2'
	if n == 1:
		print(-1)
	else:
		for i in range(1, n):
			s = s + '3'
		print(s)
T = readint()
for _ in range(T):
	solve()


n = int(input())
y = []
for i in range(n):
	y.append(int(input()))
for j in y:
	if j == 1:
		print(-1)
	else:
		print(int('2' + '3' * (j - 1)))


T = int(input())
while T > 0:
	n = int(input())
	if n == 1:
		print(-1)
	else:
		res = 10 ** n - 2
		print(res)
	T -= 1


t = int(input())
for i in range(t):
	n = int(input())
	ans = ''
	if n == 1:
		print(-1)
		continue
	ans = '5' + '3' * (n - 1)
	print(ans)


nb_cases = int(input())
for case in range(nb_cases):
	n = int(input())
	if n == 1:
		print(-1)
	else:
		print('2' + '9' * (n - 1))


from sys import stdin
r = stdin.readline

def main():
	cases = int(r())
	for case in range(cases):
		n = int(r())
		print(-1 if n == 1 else '2' + '3' * (n - 1))
main()


def solve(n):
	if n < 2:
		return -1
	first = '3' * (n - 1) + '7'
	if int(first) % 7 != 0:
		return first
	else:
		return first[:-2] + '77'

def main():
	t = int(input().strip())
	while t:
		n = int(input().strip())
		print(solve(n))
		t -= 1
main()


import math

def process(digits):
	if digits == 1:
		print('-1')
		return
	result = '2'
	for i in range(digits - 1):
		result += '7'
	print(result)
T = int(input())
for i in range(T):
	digits = int(input())
	process(digits)


for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print(-1)
		continue
	f = '3' * (n - 1) + '4'
	print(int(f))


t = int(input())
for i in range(t):
	n = int(input())
	if n == 1:
		print('-1')
	else:
		l = ['5']
		for j in range(n - 1):
			l.append('9')
		print(''.join(l))
		l.clear()


t = int(input())
for i in range(t):
	n = int(input())
	if n == 1:
		print('-1')
	else:
		print('9' * (n - 1) + '8')


t = int(input())
for _ in range(t):
	x = int(input())
	if x == 1:
		print(-1)
	elif x == 2:
		print(57)
	else:
		m = 3 * (x - 2) % 3
		if m != 1:
			print('2' + '3' * (x - 1))
		else:
			print('22' + '3' * (x - 2))


import sys
input = sys.stdin.readline
t = int(input())
for testcase in range(t):
	n = int(input())
	if n == 1:
		print(-1)
	else:
		res = ['2'] + ['3'] * (n - 1)
		print(''.join(res))


import sys
from collections import Counter

def input():
	return sys.stdin.readline().strip()

def list2d(a, b, c):
	return [[c] * b for i in range(a)]

def list3d(a, b, c, d):
	return [[[d] * c for j in range(b)] for i in range(a)]

def list4d(a, b, c, d, e):
	return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]

def ceil(x, y=1):
	return int(-(-x // y))

def INT():
	return int(input())

def MAP():
	return map(int, input().split())

def LIST(N=None):
	return list(MAP()) if N is None else [INT() for i in range(N)]

def Yes():
	print('Yes')

def No():
	print('No')

def YES():
	print('YES')

def NO():
	print('NO')
INF = 10 ** 18
MOD = 10 ** 9 + 7
for _ in range(INT()):
	N = INT()
	if N == 1:
		print(-1)
		continue
	ans = '5' + '3' * (N - 1)
	print(ans)


testCases = int(input())
for x in range(testCases):
	n = int(input())
	if n == 1:
		print('-1')
	else:
		startNumber = '2' + (n - 1) * '3'
		print(startNumber)


testCases = int(input())
for i1 in range(testCases):
	length = int(input())
	if length == 1:
		print('-1')
	else:
		result = '2' + '3' * (length - 1)
		print(result)


def solve(n):
	if n == 1:
		return -1
	num = str(2)
	for i in range(n - 1):
		num += '2'
	num = int(num)
	num += 1
	prime_digit = [3, 7, 9]
	for i in range(3):
		if num % 10 in prime_digit:
			if num % (num % 10) == 0:
				if i == 2:
					i = 0
					prime_digit = [3, 7, 9]
					num += 13 - num % 10
					continue
				for j in prime_digit:
					if num % 10 != j:
						prime_digit.remove(num % 10)
						num = num - num % 10 + j
						break
	return num
t = int(input())
for i in range(t):
	n = int(input())
	ans = solve(n)
	print(ans)


import math

def ii():
	return int(input())

def mi():
	return map(int, input().split())

def li():
	return list(mi())
for _ in range(ii()):
	n = ii()
	if n == 1:
		print(-1)
		continue
	for i in range(n):
		if i == 0:
			print('2', end='')
		else:
			print('3', end='')
	print()


def I():
	return list(map(int, input().split()))
for _ in range(int(input())):
	n = int(input())
	if n <= 1:
		print(-1)
	elif (n - 1) % 3 == 0:
		print('2' * (n - 2) + '3' * 2)
	else:
		print('2' * (n - 1) + '3')


def calculate(m):
	if m <= 1:
		return -1
	return '8' + '9' * (m - 2) + '3'
t = int(input())
while t:
	n = int(input())
	print(calculate(n))
	t -= 1


import sys

def input():
	return sys.stdin.readline().strip()

def iinput():
	return int(input())

def rinput():
	return map(int, input().split())

def rlinput():
	return list(map(int, input().split()))

def main():
	n = iinput()
	if n == 1:
		print(-1)
	elif (2 * n + 1) % 3 == 0:
		if n == 2:
			print('23')
		else:
			print('2' * (n - 2) + '3' + '3')
	else:
		print('2' * (n - 1) + '3')
for i in range(iinput()):
	main()


for _ in range(int(input())):
	l = int(input())
	if l == 1:
		print(-1)
	else:
		ans = '2'
		while len(ans) != l:
			ans += '3'
		print(ans)


import math, sys
from sys import stdin, stdout
from collections import Counter, defaultdict, deque
input = stdin.readline
I = lambda : int(input())
li = lambda : list(map(int, input().split()))

def case():
	n = int(input())
	if n == 1:
		print(-1)
		return
	print((n - 1) * '9' + '8')
for _ in range(int(input())):
	case()


for _ in range(int(input())):
	n = int(input())
	s = ''
	if n == 1:
		print(-1)
	else:
		s += '5' * (n - 1)
		print(s + '4')


m = int(input())
for i in range(m):
	x = []
	a = input()
	a = int(a)
	if a == 1:
		print(-1)
	elif (a - 1) % 3 == 0:
		x = [2 for i in range(a - 2)]
		x.append(7)
		x.append(3)
		print(''.join(map(str, x)))
	else:
		x = [2 for i in range(a - 1)]
		x.append(7)
		print(''.join(map(str, x)))


for _ in range(int(input())):
	a = int(input())
	d = len(str(a))
	k = '1' + '0' * (a - 1)
	if a == 1:
		print(-1)
	elif a >= 2:
		print('5' + '7' * (a - 1))


t = int(input())
for i in range(t):
	n = int(input())
	if n == 1:
		print(-1)
	else:
		print(10 ** n - 11)


for j in range(int(input())):
	n = int(input())
	if n == 1:
		print('-1')
	else:
		l = list('7' * n)
		l[0] = '5'
		print(''.join(l))


t = int(input())
for x in range(0, t):
	n = int(input())
	if n == 1:
		print('-1')
	else:
		print('3' * (n - 1) + '4')


t = int(input())
for _ in range(t):
	n = int(input())
	if n == 1:
		print(-1)
		continue
	a = '2' * (n - 1)
	z = int(a) * 10
	l = [i for i in range(10, n + 1, 9)]
	if n in l:
		a = '5' * (n - 1)
		z = int(a) * 10
		if (z + 8) % 8 != 0:
			print(z + 8)
			continue
	if (z + 9) % 9 != 0:
		print(z + 9)


for q in range(int(input())):
	n = int(input())
	if n == 1:
		print(-1)
	elif n == 2:
		print(57)
	elif n % 3 == 1:
		print('2' * (n - 2) + '33')
	else:
		print('2' * (n - 1) + '3')


t = int(input())
while t:
	t -= 1
	n = int(input())
	if n == 1:
		print('-1')
	elif (n - 1) % 3 != 0:
		print('2' * (n - 1) + '3')
	else:
		print('2' * (n - 2) + '33')


for _ in range(int(input())):
	n = int(input())
	if n == 1:
		ans = -1
	else:
		i = 1
		ans = '5' * i + '7' * (n - i)
		if int(ans) % 7 == 0:
			i += 1
			ans = '5' * i + '7' * (n - i)
	print(ans)


import io
import os
from collections import Counter, defaultdict, deque

def solve(N):
	if N == 1:
		return -1
	return '2' + '3' * (N - 1)
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
T = int(input())
for t in range(T):
	(N,) = [int(x) for x in input().split()]
	ans = solve(N)
	print(ans)


I = input
str = ''
for i in range(int(I())):
	n = int(I())
	if n == 1:
		print(-1)
		continue
	print((n - 2) * '2', end='')
	print(23 if (n - 2) * 2 % 3 == 0 else 33)


from random import randint
for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print(-1)
	elif n == 2:
		print('27')
	elif n == 3:
		print('227')
	elif n == 4:
		print('2227')
	elif n == 5:
		print('22227')
	else:
		num = int('2' * (n - 1) + '3')
		if num % 3:
			print(num)
		else:
			print('2' * (n - 2) + '33')


T = int(input())
for Z in range(T):
	n = int(input())
	a = ['2']
	if n == 1:
		print(-1)
	else:
		for i in range(n - 1):
			a.append('3')
		c = ''.join(a)
		print(c)


t = int(input())
for i in range(t):
	n = int(input())
	if n == 1:
		print(-1)
		continue
	print(8, end='')
	print('9' * (n - 1))


t = int(input())
while t > 0:
	n = int(input())
	if n == 1:
		print(-1)
	else:
		ans = ''
		k = n - 1
		if 2 * k % 9 == 0:
			ans = '2' * (k - 1) + '3' + '9'
		else:
			ans = '2' * k + '9'
		print(int(ans))
	t -= 1


for a0 in range(int(input())):
	n = int(input())
	if n == 1:
		print(-1)
	else:
		print('5' + (n - 1) * '3')


for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print(-1)
	else:
		c = int('7' * n) + 1
		if c % 8 == 0:
			print(c + 2)
		else:
			print(c)


n = int(input())
arr = []
for _ in range(n):
	arr.append(int(input()))
for i in range(n):
	if arr[i] == 1:
		print(-1)
	else:
		print(3 * 10 ** (arr[i] - 1) - 1)


t = int(input())
for i in range(t):
	x = int(input())
	if x == 1:
		print('-1')
	else:
		print('2', end='')
		for j in range(x - 1):
			print('3', end='')
		print('')


t = int(input())
for _ in range(t):
	n = int(input())
	if n == 1:
		print('-1')
	elif n == 2:
		print(49)
	else:
		print('9' * (n - 2) + '49')


t = int(input())
for i in range(t):
	n = int(input())
	if n == 1:
		print('-1')
	else:
		print('5' * (n - 1) + '4')


import io, os
from collections import deque
RL = lambda : list(map(int, input().split()))
T = int(input())
for _ in range(T):
	n = int(input())
	if n == 1:
		print(-1)
		continue
	s = ''
	for i in range(n):
		if i == n - 1:
			s += '4'
			continue
		s += '5'
	print(int(s))


t = int(input())
for i in range(t):
	n = int(input())
	if n == 1:
		print('-1')
		continue
	s = '2'
	for j in range(n - 1):
		s += '3'
	print(s)


def solve(n):
	res = []
	if n == 1:
		res.append(-1)
		return res[0]
	elif n > 1:
		res.append('2')
		for i in range(n - 1):
			res.append('3')
		return ''.join(res)
t = int(input())
for _ in range(t):
	n = int(input())
	print(solve(n))


for i in range(int(input())):
	j = int(input())
	if j == 1:
		print(-1)
	else:
		print('5' * (j - 1) + '4')


for _ in range(int(input())):
	x = int(input())
	print((x - 1) * '9' + '8' if not x == 1 else -1)


from sys import stdin, stdout
import heapq
import cProfile
from collections import Counter, defaultdict, deque
from functools import reduce
import math

def get_int():
	return int(stdin.readline().strip())

def get_tuple():
	return map(int, stdin.readline().split())

def get_list():
	return list(map(int, stdin.readline().split()))

def solve():
	n = get_int()
	if n == 1:
		return -1
	else:
		return '2' + '3' * (n - 1)

def main():
	print(solve())
TestCases = True
if TestCases:
	for i in range(get_int()):
		main()
else:
	main()


t = int(input())
for t0 in range(t):
	n = int(input())
	if n == 1:
		print('-1')
	elif (n - 1) * 2 % 3 != 0:
		print('2' * (n - 1) + '3')
	else:
		print('2' * (n - 2) + '43')


for _ in range(int(input())):
	ans = ''
	n = int(input())
	if n == 1:
		print(-1)
	else:
		ans += '7' * (n - 1)
		ans += '8'
		print(ans)


t = int(input())
for _ in range(t):
	ans = '2'
	n = int(input())
	if n == 1:
		print(-1)
		continue
	else:
		ans += '3' * (n - 1)
	print(int(ans))


for t in range(int(input())):
	n = int(input())
	if n == 1:
		print(-1)
		continue
	print('2' + '3' * (n - 1))


def solve():
	n = int(input())
	if n == 1:
		print(-1)
	else:
		print('2' + '3' * (n - 1))
for i in range(int(input())):
	solve()


t = int(input())
while t > 0:
	n = int(input())
	if n == 1:
		print('-1')
		t -= 1
		continue
	num = '3'
	num = num * (n - 1)
	digits = [char for char in num]
	digits.append('4')
	print(''.join(digits))
	t = t - 1


t = int(input())
for _ in range(t):
	n = int(input())
	if n == 1:
		print(-1)
	elif n % 3 == 1:
		print((n - 2) * '2' + '33')
	else:
		print((n - 1) * '2' + '3')


t = int(input())
ans = []
for _ in range(t):
	n = int(input())
	ans.append
	if n == 1:
		ans.append('-1')
	else:
		ans.append('5' + '3' * (n - 1))
print('\n'.join(ans))


import itertools
import math
import sys
import heapq
from collections import Counter
from collections import deque
from fractions import gcd
from functools import reduce
sys.setrecursionlimit(4100000)
INF = 1 << 60
t = int(input())
for i in range(t):
	n = int(input())
	if n == 1:
		print(-1)
		continue
	ans = ''
	if 2 * (n - 1) % 3 == 0:
		ans = '2' * (n - 2) + '3' * 2
	else:
		ans = '2' * (n - 1) + '3'
	print(ans)


def main():
	t = int(input())
	ans = []
	for i in range(t):
		n = int(input())
		if n == 1:
			ans.append(-1)
		else:
			ans.append('9' * (n - 1) + '4')
	for i in ans:
		print(i)
main()


t = int(input())
for i in range(t):
	n = int(input())
	if n == 1:
		print(-1)
	else:
		string = ''
		for j in range(n):
			if j == 0:
				string += '8'
			else:
				string += '9'
		print(string)


printn = lambda x: print(x, end='')
inn = lambda : int(input())
inl = lambda : list(map(int, input().split()))
inm = lambda : map(int, input().split())
ins = lambda : input().strip()
DBG = True
BIG = 10 ** 18
R = 10 ** 9 + 7

def ddprint(x):
	if DBG:
		print(x)

def isprime(x):
	q = int(math.sqrt(x))
	for i in range(2, q + 1):
		if x % i == 0:
			return False
	return True
t = inn()
for tt in range(t):
	n = inn()
	if n == 1:
		print(-1)
		continue
	k = 10 ** n - 3
	for i in range(k, 10 ** (n - 1) * 2, -2):
		if i % 10 not in [1, 5] and i % 3 != 0 and (i % 7 != 0):
			print(i)
			break


for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print(-1)
	else:
		print('2' + '7' * (n - 1))


for t in range(int(input())):
	n = int(input())
	if n == 1:
		print(-1)
		continue
	x = 1
	a = 2 * (n - 1) + 3 * x
	if a % 3 == 0:
		x += 1
		n -= 1
	print('2' * (n - 1) + '3' * x)


for _ in range(int(input())):
	n = int(input())
	m = n
	if n == 1:
		print(-1)
	elif n == 2:
		print(53)
	elif n == 3:
		print(253)
	else:
		s = '53'
		sum = 8
		for i in range(2, n - 1):
			if i % 2 == 0:
				s += '5'
				sum += 5
			else:
				s += '3'
				sum += 3
		if sum % 3 != 0:
			s += '3'
			sum += 3
		else:
			sum += 2
			s = '2' + s
		if ord(s[-1]) == ord('5'):
			s = list(s)
			s[1] = '3'
			s[-1] = '3'
			s = ''.join(s)
			sum -= 4
		print(s)


t = int(input())
while t != 0:
	n = int(input())
	if n == 1:
		print(-1)
	elif n > 1:
		print('2', end='')
		print('3' * (n - 1))
	t -= 1


t = int(input(''))
n = 0
for i in range(t):
	num = ''
	n = int(input(''))
	if n == 1:
		print('-1')
	else:
		L = [2, 3, 4, 5, 6, 7, 8, 9]
		num = '2'
		num += '3' * (n - 1)
		print(num)


import math, collections, sys
input = sys.stdin.readline

def solve():
	n = int(input())
	if n == 1:
		print(-1)
		return
	if (n - 1) % 3:
		print('2' * (n - 1) + '3')
	else:
		print('2' * (n - 2) + '4' + '3')
for _ in range(int(input())):
	solve()


t = int(input())
for i in range(0, t):
	n = int(input())
	if n == 1:
		print(-1)
	elif n >= 2:
		ans = '2'
		for j in range(1, n):
			ans = ans + '3'
		print(ans)


t = int(input())
for i in range(t):
	n = int(input())
	s = ''
	if n == 1:
		s = '-1'
	elif n % 3 == 1:
		s = ''
		s += '2' * (n - 2)
		s += '33'
	else:
		s = '2' * (n - 1)
		s += '3'
	print(s)


def solve(n):
	res = int(''.join(['7'] * (n - 1))) if n > 1 else 0
	for d in range(1, 10):
		cur = 10 * res + d
		if cur % 7 and cur % d:
			return cur
	return -1
t = int(input())
for _ in range(t):
	n = int(input())
	print(solve(n))


def main():
	t = int(input())
	for __ in range(t):
		n = int(input())
		if n == 1:
			print(-1)
		else:
			print('2' + '3' * (n - 1))
main()


n = int(input())
li = []
for i in range(n):
	li.append(int(input()))
for ele in li:
	if ele == 1:
		print(-1)
	else:
		str = '2'
		i = 1
		while i <= ele - 1:
			str += '3'
			i += 1
		print(int(str))


import math
p = lambda x: print(x, end='', sep='')
t = int(input())
for i in range(t):
	x = int(input())
	if x == 1:
		print('-1')
	else:
		p(2)
		for j in range(1, x):
			p(3)
		print()


testes = int(input())
for i in range(testes):
	n = int(input())
	if n == 1:
		print(-1)
	else:
		string = ''
		for i in range(n - 1):
			string += '3'
		string += '4'
		print(string)


for k in range(int(input())):
	n = int(input())
	l = []
	if n >= 2:
		for i in range(n - 2):
			l.append('3')
		l.append('4')
		l.append('3')
		print(''.join(l))
	else:
		print(-1)


import math
from bisect import bisect_left, bisect_right
from sys import stdin, stdout, setrecursionlimit
from collections import Counter
input = lambda : stdin.readline().strip()
print = stdout.write
t = int(input())
for i in range(t):
	n = int(input())
	if n == 1:
		print('-1\n')
	else:
		ls = ['2']
		for i in range(n - 1):
			ls.append('3')
		print(''.join(ls) + '\n')


n = int(input())
k = []
for i in range(n):
	a = int(input())
	if a == 1:
		k.append(-1)
		k.append('*')
	else:
		k.append(5)
		for b in range(a - 1):
			k.append(3)
		k.append('*')
for c in k:
	if c == '*':
		print()
	else:
		print(c, end='')


import math
t = int(input())
for _ in range(t):
	n = int(input())
	if n == 1:
		print('-1')
	elif n == 2:
		print('23')
	else:
		ans = '22'
		temp = '3' * (n - 2)
		ans = ans + temp
		print(ans)


for i in range(int(input())):
	n = int(input())
	if n == 1:
		print(-1)
	else:
		l = n - 1
		if l % 3:
			print(l * '2' + '3')
		else:
			print('4' + (l - 1) * '2' + '3')


t = int(input())
for x in range(t):
	n = int(input())
	ans = [2]
	if n == 1:
		print(-1)
	else:
		for i in range(n - 1):
			ans.append(3)
		print(''.join(map(str, ans)))


t = int(input())
while t:
	n = int(input())
	num = []
	if n == 1:
		print(-1)
	else:
		for _ in range(n - 1):
			num.append('2')
		num.append('7')
		number = ''.join(num)
		number = int(number)
		if number % 7 == 0:
			for _ in range(n - 2):
				print(2, end='')
			print(5, end='')
			print(7)
		else:
			print(number)
	t -= 1


for _ in [0] * int(input()):
	n = int(input())
	print([-1, '4' + (n - 1) * '7'][n > 1])


def num(n):
	resultado = ''
	x = 0
	for i in range(n):
		x = input()
		if x is '1':
			resultado = '-1'
			print(resultado)
		elif x in nums:
			resultado = nums[x]
			print(resultado)
		else:
			resultado = '2' + '3' * (int(x) - 1)
			print(resultado)
			nums[x] = resultado
nums = {}
num(int(input()))


from sys import stdin
from collections import deque
mod = 10 ** 9 + 7
import sys
import random
from queue import PriorityQueue
from bisect import bisect_right
from bisect import bisect_left
from collections import defaultdict
from math import sqrt, factorial, gcd, log2, inf, ceil
import heapq
input = lambda : sys.stdin.readline().rstrip()
from sys import stdin, stdout
from heapq import heapify, heappush, heappop
from itertools import permutations
from math import factorial as f

def ncr(n, r, p):
	num = den = 1
	for i in range(r):
		num = num * (n - i) % p
		den = den * (i + 1) % p
	return num * pow(den, p - 2, p) % p
from collections import defaultdict
from heapq import heappop, heappush, heapify
t = int(input())
for _ in range(t):
	n = int(input())
	if n == 1:
		print(-1)
	else:
		z = list('7' * (n - 1))
		ans = 0
		z = int(''.join(z))
		for i in range(1, 10):
			yo = z * 10 + i
			if yo % 7 != 0 and yo % i != 0:
				ans = yo
				break
		print(ans)


T = int(input())
for i in range(T):
	n = int(input())
	if n == 1:
		print(-1)
	else:
		s = '2'
		s = s + '3' * (n - 1)
		print(s)


for _ in range(int(input())):
	x = int(input())
	print(-1 if x == 1 else '5' * (x - 1) + '4')


n = int(input())
for i in range(n):
	x = int(input())
	if x == 1:
		print('-1')
	else:
		print('8', end='')
		for i in range(x - 1):
			print(9, end='')
		print()


def bad_ugly():
	for i in range(int(input())):
		x = int(input())
		if x < 2:
			print('-1')
		else:
			print('5' + '7' * (x - 1))
bad_ugly()


t = int(input())
while t > 0:
	t -= 1
	n = int(input())
	if n <= 1:
		print(int('-1'))
	elif (n - 1) % 3 == 0:
		s = '2' * (n - 2) + '43'
		print(int(s))
	else:
		s = '2' * (n - 1) + '3'
		print(int(s))


for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print(-1)
		continue
	else:
		print('5' + '9' * (n - 1))


for _ in range(int(input())):
	n = int(input())
	print(-1) if n == 1 else print('6' + (n - 1) * '9')


T = int(input())
while T > 0:
	T = T - 1
	n = int(input())
	if n == 1:
		print(-1)
	else:
		print('2' + '3' * (n - 1))


t = int(input())
for case_num in range(t):
	n = int(input())
	if n == 1:
		print(-1)
	else:
		a = [2 if i == 0 else 3 for i in range(n)]
		print(''.join(map(str, a)))


tt = input()
t = int(tt)
while t > 0:
	t = t - 1
	nu = input()
	n = int(nu)
	s = ''
	if n == 1:
		s += '-1'
	else:
		n = n - 1
		s += '2'
		while n > 0:
			n = n - 1
			s += '3'
	print(s)


for _ in range(int(input())):
	a = int(input())
	if a == 1:
		print(-1)
	else:
		print('5' + '7' * (a - 1))


for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print(-1)
	else:
		x = ['2'] * 1
		y = ['3'] * (n - 1)
		x = ''.join(x)
		y = ''.join(y)
		ans = x + y
		print(ans)


for ii in range(int(input())):
	n = int(input())
	if n == 1:
		print(-1)
	else:
		print('2' + '3' * (n - 1))


for i in range(int(input())):
	s = int(input())
	if s == 1:
		print(-1)
	else:
		p = '5'
		ans = p + (s - 1) * '7'
		print(int(ans))


import math
import os
import random
import re
import sys

def numgenerator(n):
	if n == 1:
		return '-1'
	elif (n - 1) % 3 == 0:
		numStr = '3'
		for i in range(n - 2):
			numStr = numStr + '2'
		numStr = numStr + '3'
		return numStr
	else:
		numStr = ''
		for i in range(n - 1):
			numStr = numStr + '2'
		numStr = numStr + '3'
		return numStr
t = int(input())
for x in range(t):
	num = int(input())
	print(int(numgenerator(num)))


t = int(input())
for test in range(t):
	n = int(input())
	if n == 1:
		print(-1)
	elif n == 2:
		print(67)
	elif n == 3:
		print(239)
	else:
		print(6789, end='')
		for i in range(n - 4):
			print(9, end='')
		print()


result = str()
for _ in range(int(input())):
	len_num = int(input())
	if len_num > 1:
		result += f"\n{'5' * (len_num - 1)}4"
	else:
		result += f'\n-1'
print(result.strip())


n = int(input())
t = []
for i in range(n):
	t.append(int(input()))
for i in range(len(t)):
	if t[i] == 1:
		print(-1)
	else:
		x = '23'
		for j in range(2, t[i]):
			x = x + '3'
		print(x)


import math
t = int(input())
for i in range(t):
	x = int(input())
	if x == 1:
		print('-1')
	else:
		y = (10 ** x - 1) // 9
		y = 3 * y
		y = y - 10 ** (x - 1)
		print(int(y))


from math import *
from copy import *
from sys import *

def isDivisible(n):
	s = str(n)
	for i in range(len(s)):
		if int(s[i]) == 0:
			return 0
		if int(s[i]) != 0:
			if n % int(s[i]) == 0:
				return 0
	return 1
l = [0]
for i in range(1, 100001):
	l.append(isDivisible(i))
t = int(input())
for i in range(t):
	n = int(input())
	if n == 1:
		print(-1)
	else:
		for j in range(n - 1):
			print(9, end='')
		print(4)


import sys
import math
input = sys.stdin.readline
t = int(input())
for _ in range(t):
	n = int(input())
	if n == 1:
		print(-1)
	else:
		for i in range(n):
			if i == 0:
				print(2, end='')
			else:
				print(3, end='')
		print()


from sys import stdin

def iinput():
	return int(stdin.readline())

def minput():
	return map(int, stdin.readline().split())

def linput():
	return list(map(int, stdin.readline().split()))
t = iinput()
while t:
	t -= 1
	n = iinput()
	if n == 1:
		print('-1')
	else:
		print('2' + '3' * (n - 1))


def main(n):
	if n == 1:
		return -1
	else:
		return '2' + '9' * (n - 1)
t = int(input())
for i in range(t):
	n = int(input())
	print(main(n))


t = int(input())
for i in range(0, int(t)):
	linea = int(input().split()[0])
	if linea == 1:
		print(-1)
	elif 5 * (linea - 1) % 3 != 0:
		print(int('5' * (linea - 1) + '3'))
	else:
		print(int('5' * (linea - 2) + '33'))


T = int(input())
for t in range(T):
	n = int(input())
	if n == 1:
		print(-1)
	else:
		print('2', '9' * (n - 1), sep='')


def sumf(x):
	s = 0
	for el in x:
		s += el
	return s % 3 == 0
t = int(input())
for iii in range(t):
	n = int(input())
	s = [2] * (n - 1) + [3]
	i = 0
	while sumf(s) and i < n:
		s[i] = 3
		i += 1
	if i == n:
		print(-1)
	else:
		print(''.join(map(str, s)))


t = int(input())
while t > 0:
	t -= 1
	n = int(input())
	if n == 1:
		print(-1)
	else:
		x = n - 1
		print(2, end='')
		while x > 1:
			print(3, end='')
			x -= 1
		print(3)


from sys import stdin
A = int(stdin.readline())
for k in range(0, A):
	B = int(stdin.readline())
	if B == 1:
		print(-1)
		continue
	if (B - 1) * 2 % 3 == 0:
		for t in range(0, B - 2):
			print(2, end='')
		print(4, end='')
		print(3)
	else:
		for l in range(0, B - 1):
			print(2, end='')
		print(3)


n = int(input())
for i in range(n):
	k = int(input())
	if k == 1:
		print('-1')
	elif k % 2 == 0:
		a = []
		for i in range(k // 2):
			a.append('54')
		print(''.join(a))
	else:
		a = ['4']
		for i in range(k // 2):
			a.append('54')
		print(''.join(a))


from functools import reduce
import os
import sys
from math import *
from collections import *
from fractions import *
from bisect import *
from heapq import *
from io import BytesIO, IOBase
input = lambda : sys.stdin.readline().rstrip('\r\n')

def value():
	return tuple(map(int, input().split()))

def arr():
	return [int(i) for i in input().split()]

def sarr():
	return [int(i) for i in input()]

def inn():
	return int(input())
mo = 1000000007
for _ in range(int(input())):
	n = inn()
	if n == 1:
		print(-1)
		continue
	a = [3] * (n - 2) + [2] + [3]
	print(*a, sep='')


t = int(input())
while t > 0:
	t = t - 1
	n = int(input())
	if n == 1:
		print(-1)
		continue
	s = '2' + '3' * (n - 1)
	print(s)


testCases = int(input())
for _ in range(testCases):
	n = int(input())
	if n > 1:
		print('4' + (n - 1) * '7')
	else:
		print(-1)


t = int(input())
for _ in range(t):
	n = int(input())
	num = 10 ** n - 1
	for i in range(n):
		num -= 10 ** i
		if num % 9 == 0 or num % 8 == 0:
			continue
		print(num)
		break
	else:
		print(-1)


a = int(input())
for i in range(0, a):
	b = int(input())
	c = ''
	c += '3' * (b - 1)
	if b != 1 and int(c) % 4 != 0:
		c += '4'
	else:
		c += '7'
	if b == 1:
		print('-1')
	else:
		print(c)


t = int(input())
for i in range(t):
	x = int(input())
	if x == 1:
		print(-1)
	else:
		print(10 ** x - 2)


for t in range(int(input())):
	n = int(input())
	if n == 1:
		print(-1)
	else:
		s = '2'
		for i in range(n - 1):
			s += '9'
		print(s)


s = int(input())
for i in range(s):
	a = int(input())
	if a == 1:
		print(-1)
	else:
		print('5' + (a - 1) * '7')


t = int(input())
while t:
	t -= 1
	n = int(input())
	if n <= 1:
		print(-1)
	else:
		print('9' * (n - 1) + '8')


T = int(input())
for kase in range(T):
	n = int(input())
	if n == 1:
		print(-1)
	else:
		print('2' + '3' * (n - 1))


import sys
input = sys.stdin.readline
from math import *
t = int(input())
while t > 0:
	t -= 1
	n = int(input())
	if n == 1:
		print(-1)
	else:
		print('5' + '3' * (n - 1))


kl = int(input())
for l in range(kl):
	r = '23'
	n = int(input())
	if n == 1:
		print(-1)
	elif n == 2:
		print(23)
	else:
		print('3' * (n - 2) + '23')


t = int(input())
for x in range(t):
	n = int(input())
	if n == 1:
		print(-1)
	else:
		print('3' * (n - 2) + '23')


for x in range(int(input())):
	n = int(input())
	if n == 1:
		print(-1)
	else:
		p = '2' + '3' * (n - 1)
		print(p)


t = int(input())
while t != 0:
	n = int(input())
	if n == 1:
		print(-1)
	else:
		st = '3'
		st2 = st * (n - 1) + '4'
		print(st2)
	t -= 1


t = int(input())
for tt in range(t):
	n = int(input())
	if n == 1:
		print(-1)
	else:
		print('9' * (n - 1) + '4')


def solver(n):
	if n == 1:
		return -1
	if n == 2:
		return 98
	result = '98'
	for _ in range(n - 2):
		result = result + '9'
	return result
N = input()
for _ in range(int(N)):
	n = input()
	print(solver(int(n)))


for _ in '0' * int(input()):
	n = int(input())
	if n == 1:
		print('-1')
	else:
		print(str(2) * 1 + str(3) * (n - 1))


for x in range(int(input())):
	n = int(input())
	if n == 1:
		print(-1)
	else:
		s = '2'
		print(s + (n - 1) * '9')


for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print(-1)
	else:
		s = 53
		print(53, end='')
		for i in range(n - 2):
			print(9, end='')
		print(end='\n')


t = int(input())
for case in range(t):
	n = int(input())
	if n == 1:
		ans = -1
	elif n % 9 == 1:
		ans = '2' * (n - 2) + '49'
	else:
		ans = '2' * (n - 1) + '9'
	print(ans)


def res(n):
	a = ['2' for _ in range(n - 1)]
	a = ''.join(a)
	n = n - 1
	if n % 3 == 0:
		x = a + '7'
		x_int = int(x)
		if x_int % 7 == 0:
			if (n - 2) * 2 % 3 == 0:
				x_int += 50
			else:
				x_int += 10
			print(x_int)
		else:
			print(x_int)
	else:
		print(int(a + '3'))
t = int(input())
for _ in range(t):
	n = int(input().strip())
	if n == 1:
		print(-1)
	else:
		res(n)


def func():
	n = int(input())
	if n == 1:
		print(-1)
	else:
		t = '3' * (n - 1)
		t = t + '4'
		print(t)
cas = int(input())
for i in range(cas):
	func()


for i in range(int(input())):
	n = int(input())
	if n != 1:
		if int('2' * (n - 1) + '3') % 3 != 0:
			print('2' * (n - 1) + '3')
		else:
			print('2' * (n - 2) + '33')
	else:
		print(-1)


from sys import stdin, stdout
t = int(stdin.readline())
for test in range(t):
	n = int(stdin.readline())
	if n == 1:
		stdout.write('-1\n')
	else:
		p = [2, 3]
		m = [3] * (n - 2)
		p = p + m
		print(*p, sep='')


from math import factorial
from collections import Counter, defaultdict
from heapq import heapify, heappop, heappush
import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def RL():
	return map(int, sys.stdin.readline().rstrip().split())

def N():
	return int(input())

def comb(n, m):
	return factorial(n) / (factorial(m) * factorial(n - m)) if n >= m else 0

def perm(n, m):
	return factorial(n) // factorial(n - m) if n >= m else 0

def mdis(x1, y1, x2, y2):
	return abs(x1 - x2) + abs(y1 - y2)
mod = 1000000007
INF = float('inf')

def main():
	for _ in range(N()):
		s = N()
		if s == 1:
			print(-1)
		else:
			res = '2' + '3' * (s - 1)
			print(int(res))
main()


for i in range(int(input())):
	x = int(input())
	s = '5' * (x - 1) + '4'
	print(s if x > 1 else '-1')


t = int(input())
for i in range(0, t):
	s = '5'
	n = int(input())
	if n == 1:
		print(-1)
	else:
		for i in range(0, n - 1):
			s = s + '7'
		print(s)


from bisect import bisect_left as bl
from bisect import bisect_right as br
import heapq
import math
from collections import *
from functools import reduce, cmp_to_key
import sys
sys.setrecursionlimit(10 ** 8)
input = sys.stdin.readline
M = mod = 10 ** 9 + 7

def factors(n):
	return sorted(set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0))))

def inv_mod(n):
	return pow(n, mod - 2, mod)

def li():
	return [int(i) for i in input().rstrip('\n').split()]

def st():
	return input().rstrip('\n')

def val():
	return int(input().rstrip('\n'))

def li2():
	return [i for i in input().rstrip('\n')]

def li3():
	return [int(i) for i in input().rstrip('\n')]
for _ in range(val()):
	n = val()
	if n == 1:
		print(-1)
	elif (n - 1) % 6:
		print('5' * (n - 1) + '7')
	else:
		print('5' * (n - 1) + '4')


c = int(input())
for _ in range(c):
	n = int(input())
	if n == 1:
		print(-1)
		continue
	result = '2'
	for _ in range(n - 1):
		result += '3'
	print(result)


t = int(input())
while t:
	n = int(input())
	l = []
	if n == 1:
		print(-1)
	else:
		l.append(5)
		for i in range(n - 1):
			l.append(7)
	listToStr = ''.join([str(elem) for elem in l])
	print(listToStr)
	t = t - 1


def solve():
	n = int(input())
	if n == 1:
		print('-1', end='')
	else:
		li = [2]
		li1 = [3]
		new_list = li
		if len(new_list) != n:
			new_list = new_list + li1 * (n - 1)
		for ele in new_list:
			print(ele, end='')
	print()
test = int(input())
for _ in range(test):
	solve()


lsi = []
for i in range(int(input())):
	li = ['2']
	ans = 0
	val = int(input())
	if val == 1:
		lsi.append(-1)
	else:
		for j in range(val - 1):
			li.append('3')
		ans = int(''.join(li))
		lsi.append(ans + 6)
for i in lsi:
	print(i)


flag = True
for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print(-1)
	else:
		print(int('2' + (n - 1) * '3'))


t = int(input())
s = []
for jngn in range(0, t):
	n = int(input())
	q = ''
	if n == 1:
		s.append(-1)
	else:
		q += '2'
		q += (n - 1) * '3'
		s.append(q)
for i in s:
	print(i)


for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print(-1)
	else:
		s = ''
		for i in range(n - 1):
			s += '7'
		s += '8'
		print(s)


T = int(input())
while T > 0:
	N = int(input())
	if N == 1:
		print('-1')
	else:
		print('2' + str(str(3) * (N - 1)))
	T = T - 1


t = eval(input())
for _ in range(t):
	n = eval(input())
	if n == 1:
		print('-1')
	elif (n - 1) * 2 % 3 == 0:
		for i in range(n - 2):
			print('2', end='')
		print('33')
	else:
		for i in range(n - 1):
			print('2', end='')
		print('3')


def parse(n):
	if n == 1:
		return -1
	str = '3' * (n - 1)
	return '2' + str
t = int(input())
for t1 in range(t):
	n = int(input())
	print(int(parse(n)))


t = int(input())
for _ in range(t):
	n = int(input())
	if n != 1:
		for x in range(n - 1):
			if x == 0:
				print(2, end='')
			print(3, end='')
		print('')
	else:
		print(-1)


from sys import stdin, stdout
from collections import defaultdict, Counter
from functools import lru_cache
from math import gcd, floor, ceil

def ilist():
	return [int(x) for x in stdin.readline().strip().split(' ')]

def iint():
	return int(stdin.readline().strip())

def istr():
	return stdin.readline().strip()
t = iint()
for _x in range(t):
	n = iint()
	if n == 1:
		print(-1)
	else:
		print('2' + (n - 1) * '3')


import math

def inp():
	return int(input())

def inlist():
	return list(map(int, input().split()))

def instr():
	s = input()
	return list(s[:len(s)])

def invr():
	return map(int, input().split())
t = inp()
while t:
	n = inp()
	res = '2'
	if n == 1:
		print(-1)
	else:
		for i in range(n - 1):
			res += '3'
		print(res)
	t -= 1


t = int(input())
ans = []
for _ in range(t):
	l = int(input())
	if l == 1:
		print(-1)
	else:
		print(2, end='')
		for i in range(3, l + 2):
			print(3, end='')
		print()


from bisect import bisect, bisect_left

def linp():
	return list(map(int, input().split(' ')))

def slinp():
	return sorted(linp())

def inp():
	return int(input())

def fnp():
	return float(input())

def dinp():
	s = linp()
	return (s[0], s[1])

def tinp():
	s = linp()
	return (s[0], s[1], s[2])

def main():
	n = inp()
	if n == 1:
		print(-1)
	else:
		print('2', end='')
		for i in range(n - 1):
			print('9', end='')
		print(' ')
t = inp()
for i in range(t):
	main()


import sys
t = int(sys.stdin.readline())
for _ in range(t):
	n = int(sys.stdin.readline())
	if n == 1:
		print('-1')
		continue
	for _ in range(n - 2):
		print('3', end='')
	print('23')


n = int(input())
numbers = []
for i in range(n):
	numbers.append(int(input()))
for num in numbers:
	if num == 1:
		print(-1)
	elif num == 2:
		print(57)
	else:
		print('2' + '3' * (num - 2) + '9')


def check(n):
	x = n
	while x:
		r = x % 10
		if r == 0:
			x //= 10
			continue
		x //= 10
		if n % r == 0:
			return False
	return True
for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print(-1)
		continue
	ans = int('2' * n)
	ans += 1
	if (n - 1) % 3 == 0:
		ans += 10
	print(ans)


def main():
	for i in range(int(input())):
		n = int(input())
		if n == 1:
			print(-1)
		else:
			pre_s = '2' * (n - 1) + '3'
			if int(pre_s) % 3 == 0:
				print('4' + '2' * (n - 2) + '3')
			else:
				print(pre_s)
main()


import math
func = len

def solve():
	n = int(input())
	if n == 1:
		return -1
	res = '2'
	for i in range(n - 1):
		res += '3'
	return res
for i in range(int(input())):
	print(solve())


import sys
input = sys.stdin.readline
t = int(input())
for t1 in range(t):
	n = int(input())
	if n == 1:
		print(-1)
	else:
		z = '3' * (n - 1)
		z += '4'
		print(int(z))


from collections import defaultdict as dd
from collections import deque
import bisect
import heapq

def ri():
	return int(input())

def rl():
	return list(map(int, input().split()))

def solve():
	n = ri()
	if n == 1:
		print(-1)
		return
	else:
		print('2' + '9' * (n - 1))
		return
mode = 'T'
if mode == 'T':
	t = ri()
	for i in range(t):
		solve()
else:
	solve()


import sys
input = sys.stdin.readline

def main():
	t = int(input())
	for _ in range(t):
		N = int(input())
		if N == 1:
			print(-1)
			continue
		print('5' + '3' * (N - 1))
main()


d = dict()
for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print(-1)
	elif n in d:
		print(d[n])
	else:
		a = [5] * (n - 1)
		a.append(3)
		for i in range(2, 10):
			if i != 5:
				a[n - 1] = i
				s = ''.join(map(str, a))
				x = int(s)
				if x % i != 0:
					break
		print(s)
		d[n] = s


for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print('-1')
	else:
		s = '2'
		s = s * int(n - 1)
		if int(s) % 3 == 0:
			print(s[:len(s) - 1] + '33')
		else:
			print(s + '3')


t = int(input())
for _ in range(t):
	n = int(input())
	a = []
	if n == 1:
		print('-1')
	elif n == 2:
		print(23)
	else:
		print(22, end='')
		for i in range(2, n):
			print(3, end='')
		print()


def main_function():
	t = int(input())
	for i in range(t):
		n = int(input())
		if n == 1:
			print('-1')
			continue
		print('2' + '3' * (n - 1))
main_function()


for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print(-1)
	else:
		ans = [2 for x in range(n)]
		ans[-1] = 3
		if sum(ans) % 3 == 0:
			ans[-2] = 3
		print(''.join(map(str, ans)))


t = int(input())
for i in range(t):
	n = int(input())
	if n != 1 and n != 2:
		if (n - 2) % 3 != 0:
			res = ['3'] + ['2'] * (n - 2) + ['3']
		else:
			res = ['3', '3'] + ['2'] * (n - 3) + ['3']
	elif n == 2:
		res = ['2', '3']
	else:
		res = ['-1']
	print(''.join(res))


def ok(k):
	for i in k:
		if int(k) % int(i) == 0:
			return False
	return True
arr = ['3'] * (10 ** 5 + 10)
arr[0] = '2'
for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print(-1)
		continue
	print(''.join(arr[:n]))


import sys
input = sys.stdin.readline
for ti in range(int(input().strip())):
	n = int(input().strip())
	if n == 1:
		print('-1')
	elif (n - 1) * 2 % 3 != 0:
		print('2' * (n - 1) + '3')
	else:
		print('2' * (n - 2) + '33')


t = int(input())
numbers = []
for i in range(0, t):
	numbers.append(int(input()))
for i in range(0, t):
	if numbers[i] == 1:
		print(-1)
	elif (numbers[i] - 1) % 3 != 0:
		num = ''
		for j in range(0, numbers[i] - 1):
			num = num + '2'
		num = num + '3'
	else:
		num = ''
		for j in range(0, numbers[i] - 2):
			num = num + '2'
		num = num + '3'
		num = num + '3'
	if numbers[i] != 1:
		print(num)


for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print(-1)
	elif (n - 1) * 2 % 9 == 0:
		print('2' * (n - 2) + '39')
	else:
		print('2' * (n - 1) + '9')


def make(n):
	S = '3' * n
	Ans = '2' + S
	return Ans
T = int(input())
for _ in range(T):
	n = int(input())
	if n == 1:
		print(-1)
	else:
		print(make(n - 1))


import math
t = int(input())
for i in range(t):
	u = int(input())
	if u == 1:
		print('-1', end='')
	else:
		print('2', end='')
		for i in range(u - 1):
			print('3', end='')
	print('')


import math
a = int(input())
for i in range(0, a):
	n = int(input())
	arr = ['2']
	if n == 1:
		print(-1)
	else:
		for i in range(n - 1):
			arr.append('3')
		print(''.join(arr))


def ii():
	return int(input())

def mii():
	return map(int, input().split())

def lmii():
	return list(mii())

def main():
	for _ in range(ii()):
		n = ii()
		if n == 1:
			print(-1)
		else:
			ans = '5'
			ans += '7' * (n - 1)
			print(ans)
main()


n = int(input())
i = 0
ans = []
while i < n:
	a = int(input())
	if a == 1:
		ans.append(-1)
	else:
		ans.append('2' + (a - 1) * '7')
	i += 1
for i in ans:
	print(i)


def solution():
	from sys import stdout, stdin
	(_input, _print) = (stdin.readline, stdout.write)
	(_list, _range, _str, _len, _int) = (list, range, str, len, int)
	for _ in _range(_int(_input())):
		n = _int(_input())
		if n == 1:
			print(-1)
			continue
		else:
			k = _int('2' + '3' * (n - 1))
			print(k)
solution()


def f(n):
	if n == 1:
		return '-1'
	ans = '23'
	for i in range(n - 2):
		ans += '3'
	return ans

def main():
	t = int(input())
	for _ in range(t):
		n = int(input())
		print(f(n))
main()


for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print(-1)
	elif n % 3 == 1:
		print('5', '2' * (n - 3), '4', '3', sep='')
	else:
		print('5', '2' * (n - 2), '3', sep='')


t = int(input())
for i in range(t):
	n = int(input())
	if n == 1:
		print(-1)
	else:
		print(2, end='')
		for j in range(n):
			print((n - 1) * str(3))
			break


for _ in range(int(input())):
	No = int(input())
	if No <= 1:
		print('-1')
		continue
	s = '2' + '3' * (No - 1)
	print(s)


t = int(input())
res = []
for i in range(t):
	n = int(input())
	if n < 2:
		res.append(-1)
	else:
		s = '3' * (n - 1)
		s = '2' + s
		res.append(int(s))
for i in res:
	print(i)


t = int(input())
for _ in range(t):
	n = int(input())
	if n == 1:
		print(-1)
		continue
	l = ['3'] * (n - 1)
	l.insert(0, '2')
	print(''.join(l))


for i in range(int(input())):
	k = int(input())
	print('2' + '3' * (k - 1) if k != 1 else '-1')


def solve(n):
	if n == 1:
		return -1
	return '2' + '3' * (n - 1)
t = int(input())
for i in range(t):
	n = int(input())
	y = solve(n)
	print(y)


cases = int(input())
for i in range(cases):
	n = int(input())
	if n == 1:
		print(-1)
	else:
		res = ['2'] * (n - 1)
		if (3 + 2 * (n - 1)) % 3 == 0:
			res[0] = '3'
		print(''.join(res) + '3')


import pdb

def solve(n):
	s = ''
	if n == 1:
		return '-1'
	else:
		for i in range(n - 1):
			s = s + '2'
		s = s + '3'
		if eval(s) % 3 == 0:
			s = s[0:len(s) - 1]
			s = s + '7'
			if eval(s) % 7 == 0:
				s = s[0:len(s) - 1]
				s = s + '9'
				if eval(s) % 9 == 0:
					s1 = '2'
					s = s.replace('2', '3')
					s1 = s1 + s[0:len(s) - 1]
					s = s1
		return s
t = int(input())
p = []
for i in range(t):
	user = int(input())
	p.append(solve(user))
for j in p:
	print(j)


for i in range(int(input())):
	a = int(input())
	if a == 1:
		print(-1)
	elif a == 2:
		print(23)
	elif a == 3:
		print(239)
	elif a % 3 == 0:
		print((a - 1) * '5' + '3')
	else:
		print('2' + (a - 1) * '3')


T = int(input())
for z in range(T):
	n = int(input())
	if n == 1:
		print(-1)
	elif (n - 1) % 9 == 0:
		print('2' * (n - 2) + '99')
	else:
		print('2' * (n - 1) + '9')


from sys import stdin, stdout
t = int(stdin.readline())
x = []
for i in range(0, t):
	n = int(input())
	x.append(n)
for i in range(0, t):
	s = '23'
	if x[i] == 1:
		print('-1')
	elif len(s) != x[i]:
		for j in range(0, x[i] - len(s)):
			s = s + '3'
		print(int(s))
	else:
		print(int(s))


for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print(-1)
	else:
		res = [3] * (n - 1)
		res.insert(0, 2)
		print(*res, sep='')


no_of_inputs = int(input())
for i in range(no_of_inputs):
	x = int(input())
	if x == 1:
		print(-1)
	else:
		print('5' + '3' * (x - 1))


s = int(input())
for i in range(0, s):
	k = int(input())
	n = '3'
	if k == 1:
		print(-1)
	else:
		n = n * (k - 1)
		print('2' + n)


t = int(input())
while t != 0:
	t -= 1
	n = int(input())
	if n == 1:
		print(-1)
	else:
		s = ''
		for i in range(n - 1):
			s = s + '5'
		s = s + '4'
		print(int(s))


import os
import sys
from io import BytesIO, IOBase

def solution(n):
	if n == 1:
		write(-1)
		return
	i = 1
	res = '2' * (n - i) + '7' * i
	while int(res) % 7 == 0 and i < n:
		i += 1
		res = '2' * (n - i) + '7' * i
	write(res)

def main():
	for _ in range(r_int()):
		n = r_int()
		solution(n)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))

def input():
	return sys.stdin.readline().rstrip('\r\n')

def write(*args, end='\n'):
	for x in args:
		sys.stdout.write(str(x) + ' ')
	sys.stdout.write(end)

def r_array():
	return [int(x) for x in input().split()]

def r_int():
	return int(input())

def w_array(arr):
	for x in arr:
		write(x, end=' ')
	write()
main()


for _ in range(int(input())):
	n = int(input())
	ans = '2'
	if n == 1:
		print(-1)
	else:
		n = n - 1
		while n:
			ans += '3'
			n -= 1
		print(ans)


import sys
import math
from collections import deque

def read_line():
	return sys.stdin.readline()[:-1]

def read_int():
	return int(sys.stdin.readline())

def read_int_line():
	return [int(v) for v in sys.stdin.readline().split()]
t = read_int()
for i in range(t):
	n = read_int()
	if n == 1:
		print(-1)
	else:
		str = '2'
		str = str + '3' * (n - 1)
		print(str)


for _ in range(int(input())):
	n = int(input())
	x = '2'
	if n == 1:
		print(-1)
	else:
		for i in range(n - 1):
			x = x + '3'
		print(str(x))


for i in range(int(input())):
	n = int(input())
	if n == 1:
		print('-1')
	else:
		for i in range(1, n):
			print('9', end='')
		print('4')


t = int(input())
ls = []
for i in range(t):
	n = int(input())
	ls.append(n)
for i in range(len(ls)):
	if ls[i] == 1:
		print(-1)
	else:
		print('2', end='')
		for j in range(ls[i] - 1):
			print('3', end='')
		print('')


a = int(input())
for i in range(a):
	b = int(input())
	c = '7'
	d = (b - 1) * c
	if b == 1:
		print(-1)
	else:
		print('2' + d)


t = int(input())
for i in range(t):
	n = int(input())
	if n == 1:
		print(-1)
	else:
		p = ['3'] * (n - 1)
		q = ''.join(p)
		s = '2'
		s += q
		print(s)


for test in range(int(input())):
	A = int(input())
	if A == 1:
		print('-1')
	else:
		print('2', end='')
		for number in range(A - 1):
			print('3', end='')
		print(' ')


from math import inf
t = int(input())
for q in range(t):
	n = int(input())
	if n == 1:
		print(-1)
	else:
		for i in range(n - 2):
			print(7, end='')
		print(67)


def create_number():
	s = ''
	for i in range(n):
		if i == 0:
			s = s + '7'
			continue
		if (n - 1) % 6 == 0 and i == n - 1:
			s = s + '7'
			continue
		s = s + '2'
	return s
numcases = input()
numcases = int(numcases)
for i in range(numcases):
	n = int(input())
	if n == 1:
		print('-1')
	else:
		string = create_number()
		print(string[::-1])


import bisect
from functools import lru_cache
t = int(input())
for _ in range(t):
	n = int(input())
	if n == 1:
		print(-1)
	elif n % 2 == 0:
		print(str(2) + '3' * (n - 1))
	else:
		print('2' * 2 + '3' * (n - 2))


def badug(n):
	if n == 1:
		return -1
	else:
		s = '23' + '3' * (n - 2)
		return int(s)
t = int(input())
for i in range(0, t):
	n = int(input())
	print(badug(n))


def BadUgly(N):
	if N == 1:
		return -1
	elif N == 2:
		return 43
	else:
		pre_fix = ''
		N -= 2
		if N & 1:
			pre_fix += '4'
			N -= 1
		pre_fix += '54' * (N // 2)
		return pre_fix + '43'
t = int(input())
for iter_t in range(t):
	_input = int(input())
	result = BadUgly(_input)
	print(result)


t = int(input())
while t > 0:
	t -= 1
	n = int(input())
	if n == 1:
		print(-1)
	elif n == 2:
		print(23)
	else:
		print('2' + '6' + '3' * (n - 2))


t = int(input())
ans = []
for i in range(t):
	n = int(input())
	if n < 2:
		ans.append(-1)
	else:
		s = '2'
		for i in range(1, n):
			s += '7'
		ans.append(s)
for i in ans:
	print(i)


for i in range(int(input())):
	n = int(input())
	if n == 1:
		print(-1)
	else:
		print(int('7' * (n - 1) + '4'))


from sys import stdin
import math
inp = lambda : stdin.readline().strip()
t = int(inp())
for _ in range(t):
	n = int(inp())
	if n == 1:
		print(-1)
	else:
		print(2, end='')
		for i in range(n - 1):
			print(3, end='')
		print('')


from sys import exit

def i():
	return input()

def ii():
	return int(input())

def iis():
	return map(int, input().split())

def liis():
	return list(map(int, input().split()))

def print_array(a):
	print(' '.join(map(str, a)))
t = ii()
for _ in range(t):
	n = ii()
	if n == 1:
		print(-1)
	else:
		print('2' + '3' * (n - 1))


for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print(-1)
		continue
	print('5' * (n - 1) + '8')


import math
for z in range(int(input())):
	n = int(input())
	if n > 1:
		for i in range(n):
			if i == n - 2:
				print('4', end='')
			else:
				print('3', end='')
		print('')
	else:
		print(-1)


a = int(input())
for i in range(a):
	b = int(input())
	if b == 1:
		print(-1)
	else:
		s = ''
		s += '2' + '3' * (b - 1)
		print(s)


for _ in range(int(input())):
	n = int(input())
	print(['-1', '4' + '7' * (n - 1)][n > 1])


def main():
	t = int(input())
	while t != 0:
		n = int(input())
		if n == 1:
			print(-1)
		else:
			print(2, end='')
			for i in range(n - 1):
				print(3, end='')
			print()
		t -= 1
main()


from functools import lru_cache
from collections import *
t = int(input())
while t:
	t -= 1
	n = int(input())
	if n == 1:
		print(-1)
		continue
	res = []
	for i in range(n - 1):
		res.append(2)
	res.append(3)
	if sum(res) % 3 == 0:
		res[0] = 4
	print(''.join(map(str, res)))


r = int(input())
for i in range(r):
	n = int(input())
	if n == 1:
		res = -1
	else:
		res = '2' + (n - 1) * '3'
	print(res)


for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print(-1)
	elif (n - 1) * 5 % 3 == 0:
		print('5' * (n - 2) + '33')
	else:
		print('5' * (n - 1) + '3')


import time
t = int(input())
inp = []
for i in range(t):
	inp.append(int(input()))
nos = 0
b = []
while nos < t:
	a = ''
	if inp[nos] == 1:
		b.append('-1')
	else:
		for i in range(int(inp[nos])):
			if i == int(inp[nos]) - 1:
				a = a + '8'
			else:
				a = a + '9'
		b.append(a)
	nos = nos + 1
for i in range(len(b)):
	print(b[i])


t = int(input())
for t_ in range(t):
	n = int(input())
	if n == 1:
		print(-1)
	elif n % 3 == 1:
		print('2' * (n - 2) + '3' * 2)
	else:
		print('2' * (n - 1) + '3')


n = 100000
s = list()

def digit():
	global n, s
	s.append('2')
	for i in range(1, n):
		s.append('3')
	return
t = int(input())
digit()
while t:
	n = int(input())
	if n == 1:
		print(-1)
	else:
		print(''.join(s[:n]))
	t -= 1


A = []
T = int(input())
for i in range(T):
	A.append(int(input()))
for n in A:
	if n == 1:
		print(-1)
	else:
		print(2, end='')
		for j in range(n - 2):
			print(3, end='')
		print(3)


N = int(input())
for _ in range(N):
	n = int(input())
	if n == 1:
		print(-1)
		continue
	if 2 * (n - 1) % 3 != 0:
		print('2' * (n - 1) + '3')
	else:
		print('2' * (n - 2) + '77')


def as_number(c):
	c_as_number = ''
	for i in range(len(c)):
		c_as_number = c_as_number + str(c[i])
	c_as_number = int(c_as_number)
	return c_as_number

def main():
	t = int(input())
	while t > 0:
		t = t - 1
		s = input()
		if s == '1':
			print(-1)
		else:
			c = (int(s) - 1) * [2]
			c.append(3)
			if sum(c) % 3 == 0:
				c[0] = 3
			print(as_number(c))
main()


t = int(input())
while t > 0:
	t -= 1
	n = int(input())
	if n == 1:
		print('-1')
	else:
		print('5' + (n - 1) * '7')


for t in range(int(input())):
	n = int(input())
	if n == 1:
		print(-1)
	elif n == 2:
		print(23)
	elif n == 3:
		print(223)
	elif n % 2 == 0 and n % 3 != 0:
		print('53' * (n // 2))
	elif n % 2 == 1 and n % 3 == 0:
		print('5' + '53' * (n // 2))
	elif n % 2 == 0 and n % 3 == 0:
		print('55' + '53' * (n // 2 - 1))
	elif n % 2 == 1 and n % 3 == 2:
		print('5' * (n - 1) + '3')
	elif n % 2 == 1 and n % 3 == 1:
		print('3' + '5' * (n - 2) + '3')


def get_numbers(n):
	if n < 2:
		print(-1)
	else:
		print(10 ** n - 2)
t = int(input())
for _ in range(t):
	get_numbers(int(input()))


t = int(input())
for _ in range(t):
	a = int(input())
	if a == 1:
		print(-1)
	else:
		print(8, end='')
		for _ in range(1, a):
			print(9, end='')
		print('')


def find(n):
	if n == 1:
		return -1
	else:
		return 10 ** n - 2

def io():
	T = int(input())
	for i in range(T):
		n = int(input())
		print(find(n))
io()


t = int(input())
while t != 0:
	n = int(input())
	if n == 1:
		print(-1)
	elif n == 2:
		print(54)
	else:
		A = '8' * (n - 2) + '54'
		print(int(A))
	t -= 1


t = int(input())
i = 0
while i < t:
	n = int(input())
	if n == 1:
		print(-1)
		pass
	else:
		for j in range(n - 1):
			print(3, end='')
		print(4)
	i = i + 1


t = int(input())
while t > 0:
	n = int(input())
	if n == 1:
		print(-1)
	else:
		print(10 ** n - 2)
	t -= 1


import sys
input = sys.stdin.readline

def getInt():
	return int(input())

def getVars():
	return map(int, input().split())

def getList():
	return list(map(int, input().split()))

def getStr():
	return input().strip()
t = getInt()
for _ in range(t):
	n = getInt()
	if n > 1:
		print('8' + '7' * (n - 1))
	else:
		print(-1)


t = int(input())
for i in range(t):
	x = int(input())
	if x == 1:
		print(-1)
	elif 2 * (x - 1) % 3 != 0:
		print('2' * (x - 1) + '3')
	else:
		print('2' * (x - 2) + '33')


def sol(n):
	if n == 1:
		return -1
	else:
		return '2' + '3' * (n - 1)
g = int(input())
results = list()
for i in range(0, g):
	m = int(input())
	results.append(sol(m))
for result in results:
	print(result)


t = int(input())
for i in range(t):
	n = int(input())
	if n == 1:
		print(-1)
	elif n == 2:
		print(23)
	else:
		s = ''
		for j in range(n - 2):
			s += '3'
		s += '2'
		s += '3'
		print(s)


def f(n):
	if n == 1:
		return -1
	return int('2' + '3' * (n - 1))
for i in range(int(input())):
	n = int(input())
	b = f(n)
	print(b)


a = int(input())
for i in range(a):
	c = int(input())
	if c == 1:
		print(-1)
	else:
		print('8' + '9' * (c - 1))


t = int(input())
while t:
	n = int(input())
	if n == 1:
		print(-1)
	else:
		l = ['2']
		for i in range(0, n - 1):
			l.append('3')
		s = ''
		for i in l:
			s = s + i
		a = int(s)
		print(a)
	t = t - 1


t = int(input())
out = []
for rep in range(t):
	n = int(input())
	if n == 1:
		out.append('-1')
	else:
		out.append('2' + '3' * (n - 1))
print('\n'.join(out))


import math
case = int(input())
for i in range(case):
	n = int(input())
	if n == 1:
		print(-1)
	else:
		print('2' + '3' * (n - 1))


import sys

def fastio():
	from io import StringIO
	from atexit import register
	global input
	sys.stdin = StringIO(sys.stdin.read())
	input = lambda : sys.stdin.readline().rstrip('\r\n')
	sys.stdout = StringIO()
	register(lambda : sys.__stdout__.write(sys.stdout.getvalue()))
fastio()
INF = 10 ** 20
MOD = 10 ** 9 + 7
I = lambda : list(map(int, input().split()))
from math import gcd
from math import ceil
from collections import defaultdict as dd, Counter
from bisect import bisect_left as bl, bisect_right as br
(t,) = I()
while t:
	t -= 1
	(n,) = I()
	if n == 1:
		print(-1)
	else:
		print('3' * (n - 1) + '4')


for _ in range(int(input())):
	x = int(input())
	print(-1 if x == 1 else '2' * (x - 1) + '3' if (x - 1) * 2 % 3 != 0 else '2' * (x - 2) + '4' + '3')


from sys import stdin, stdout
import sys, os

def func(s):
	if s == 1:
		return -1
	return ''.join(['2' if x == 0 else '3' for x in range(s)])
test_range = int(input())
for i in range(test_range):
	s = int(input())
	print(func(s))


t = int(input())
for x in range(t):
	length = int(input())
	if length == 1:
		print(-1)
	else:
		decimal = (length - 1) * '2' + '3'
		if int(decimal) % 3 == 0:
			decimal = decimal[:-1] + '7'
			if int(decimal) % 7 == 0:
				decimal = decimal[:-1] + '9'
				while int(decimal) % 9 == 0:
					number = int(decimal)
					number += 10
					decimal = str(number)
					decimal = decimal.replace('1', '2').replace('0', '2')
		print(decimal)


for i in range(int(input())):
	n = int(input())
	f = '2' * (n - 1) + '3'
	if n == 1:
		print(-1)
	elif int(f) % 3 == 0:
		f = '2' * (n - 2) + '43'
		print(f)
	else:
		print(f)


from itertools import *

def func(num):
	num = int(num)
	if num == 1:
		print('-1')
		return
	elif num == 3:
		print('239')
		return
	res = ''
	if num % 2 == 0:
		res = '24' * (num // 2 - 1)
		res += '23'
	else:
		res = '44' * (num // 2 - 1)
		res += '338'
		if int(res) % 3 == 0:
			res = '44' * (num // 2 - 1)
			res += '339'
	print(res)

def main():
	k = int(input())
	for i in range(k):
		num = input()
		func(num)
main()


import os
import io
from collections import Counter
from collections import defaultdict
import math
import random
import heapq as hq
from math import sqrt
import sys
from functools import reduce
from collections import deque
import threading

def input():
	return sys.stdin.readline().strip()

def iinput():
	return int(input())

def tinput():
	return input().split()

def rinput():
	return map(int, tinput())

def rlinput():
	return list(rinput())
mod = int(1000000000.0) + 7

def factors(n):
	return set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0)))
for _ in range(iinput()):
	n = iinput()
	if n == 1:
		print(-1)
	else:
		print('2' + '3' * (n - 1))


t = int(input())
for _ in range(t):
	n = int(input())
	res = 0
	if n == 1:
		print('-1')
	else:
		res = '2' + '3' * (n - 1)
		print(res)


for i in range(int(input())):
	n = int(input())
	if n == 1:
		print(-1)
		continue
	s = str(2)
	s1 = str(3)
	s1 *= n - 1
	s += s1
	print(int(s))


t = int(input())
for I in range(t):
	n = int(input())
	if n == 1:
		print(-1)
	elif n % 2 == 0:
		print(2, end='')
		for j in range(n - 1):
			print(3, end='')
		print()
	else:
		print(22, end='')
		for j in range(n - 2):
			print(3, end='')
		print()


for _ in '0' * int(input()):
	n = int(input())
	a = -1
	if n == 1:
		print(-1)
	else:
		print('3' * (n - 2) + '34')


from math import *
from copy import *
from string import *
from random import *
from bisect import *
from sys import stdin
from sys import maxsize
from operator import *
from itertools import *
from collections import Counter
from collections import defaultdict

def solve(n):
	if n == 1:
		return -1
	else:
		s = ''
		if (n - 1) % 3 == 0:
			s = '3' * (n - 1) + '4'
		else:
			s = '2' * (n - 1) + '3'
		return int(s)
T = int(input())
for _ in range(T):
	N = int(stdin.readline())
	print(solve(N))


import sys
from math import sqrt
inp = sys.stdin.readline

def is_prime(n):
	for i in range(2, int(sqrt(n)) + 1):
		if n % i == 0:
			return False
	return True

def a():
	ans = ''
	for _ in range(int(inp())):
		n = int(inp())
		s = ''
		if n == 1:
			s = '-1'
		else:
			s = '34'
			n -= 2
			if n > 0:
				s += '3' * n
		ans += s + '\n'
	print(ans)

def b():
	n = int(inp())
	arr = list(map(int, inp().split()))
	arr2 = [arr[0]]
	maxi = arr[0]
	for i in range(1, n):
		arr2.append(maxi + arr[i])
		maxi = max(maxi, arr2[i])
	print(*arr2)
a()


for i in range(int(input())):
	x = int(input())
	if x == 1:
		print(-1)
	elif int('2' * (x - 1) + '3') % 3 != 0:
		print('2' * (x - 1) + '3')
	else:
		print('4' + '2' * (x - 2) + '3')


s2 = int(input())
for _ in range(s2):
	n = int(input())
	if n == 1:
		print(-1)
	else:
		print(5, end='')
		for i in range(1, n):
			print(7, end='')
		print()


t = int(input())
while t > 0:
	t -= 1
	n = int(input())
	if n == 1:
		print(-1)
	else:
		while n > 2:
			print(7, end='')
			n -= 1
		print(57)


for i in range(int(input())):
	e = int(input())
	a = int('2' * (e - 1) + '3')
	if e == 1:
		print(-1)
	elif a % 3 != 0:
		print(a)
	else:
		a = str(a)
		a = a.replace('2', '3', 1)
		print(a)


import sys
import heapq
from math import ceil, floor, gcd, fabs, factorial, fmod, sqrt
from collections import defaultdict as dd, deque, Counter as c
from itertools import combinations as comb, permutations as perm
from bisect import bisect_left as bl, bisect_right as br, bisect
mod = pow(10, 9) + 7
mod2 = 998244353

def data():
	return sys.stdin.readline().strip()

def out(var):
	sys.stdout.write(str(var))

def l():
	return list(sp())

def sl():
	return list(ssp())

def sp():
	return map(int, data().split())

def ssp():
	return map(str, data().split())

def l1d(n, val=0):
	return [val for i in range(n)]

def l2d(n, m, val=0):
	return [[val for i in range(n)] for j in range(m)]
for _ in range(int(data())):
	n = int(data())
	if n == 1:
		out('-1\n')
		continue
	if (n - 1) % 3 == 0:
		for i in range(n - 2):
			out('2')
		for i in range(2):
			out('3')
	else:
		for i in range(n - 1):
			out('2')
		out('3')
	out('\n')


t = int(input())
while t:
	n = int(input())
	if n == 1:
		print(-1)
	else:
		print('2' + '3' * (n - 1))
	t -= 1


import sys
input = sys.stdin.readline
t = int(input())
for _ in range(t):
	n = int(input())
	if n == 1:
		print(-1)
	else:
		print((10 ** n - 1) // 9 * 7 - 3)


testcases = int(input())
for i in range(testcases):
	n = int(input())
	ans = ['5']
	ans.append('7' * (n - 1))
	a = ''.join(ans)
	if n != 1:
		print(a)
	else:
		print(-1)


t = int(input())
for _ in range(t):
	n = int(input())
	if n == 1:
		print(-1)
		continue
	x = '2' * (n - 1) + '9'
	if int(x) % 9 == 0:
		x = '2' + '3' * (n - 2) + '9'
	print(x)


for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print(-1)
	else:
		temp = ''
		temp1 = n - 1
		print(2, end='')
		for i in range(0, temp1):
			print(3, end='')
		print('')


for i in range(int(input())):
	n = int(input())
	b = [2]
	if n == 1:
		print('-1')
	else:
		for i in range(n - 1):
			b.append(3)
		b = ''.join((str(i) for i in b))
		print(b)


for i in range(int(input())):
	s = int(input())
	if s == 1:
		print('-1')
	else:
		print('2', end='')
		print('3' * (s - 1))


import sys

def get_ints():
	return map(int, sys.stdin.readline().strip().split())

def get_array():
	return list(map(int, sys.stdin.readline().strip().split()))

def get_string():
	return sys.stdin.readline().strip()
t = int(input())
for test in range(t):
	n = int(input())
	if n == 1:
		print(-1)
		continue
	ans = '9'
	s = 9
	s = max(n - 2, 0) * 2 + 9
	ans = max(n - 2, 0) * '2' + '9'
	fs = 0
	for i in range(2, 10):
		if (s + i) % 9 != 0:
			fs = i
	ans = str(fs) + ans
	print(ans)


for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print('-1')
	else:
		print('9' * (n - 1), end='')
		s = '9' * (n - 1)
		for i in range(4, 10):
			s1 = s + str(i)
			if int(s1) % i == 0:
				continue
			else:
				break
		print(i)


t = int(input())
while t:
	t -= 1
	n = int(input())
	if n == 1:
		print(-1)
		continue
	else:
		k = n - 1
		if (n - 1) % 3 != 0:
			ans = (n - 1) * '5'
			ans += '3'
		else:
			ans = (n - 1) * '3'
			ans += '4'
		print(ans)


def main():
	t = int(input())
	for i in range(t):
		n = int(input())
		if n == 1:
			print(-1)
			continue
		s = '2'
		s = s + '3' * (n - 1)
		print(int(s))
main()


for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print(-1)
	else:
		for i in range(1, n + 1):
			if (i * 3 + (n - i) * 2) % 3 != 0:
				print('2' * (n - i) + '3' * i)
				break


import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul, sub
sys.setrecursionlimit(100000)
input = sys.stdin.readline
INF = 2 ** 62 - 1

def read_int():
	return int(input())

def read_int_n():
	return list(map(int, input().split()))

def read_float():
	return float(input())

def read_float_n():
	return list(map(float, input().split()))

def read_str():
	return input().strip()

def read_str_n():
	return list(map(str, input().split()))

def error_print(*args):
	print(*args, file=sys.stderr)

def mt(f):
	import time

	def wrap(*args, **kwargs):
		s = time.time()
		ret = f(*args, **kwargs)
		e = time.time()
		error_print(e - s, 'sec')
		return ret
	return wrap

@mt
def slv(N):
	if N == 1:
		return -1
	s = ['2']
	for _ in range(N - 1):
		s.append('3')
	return ''.join(s)

def main():
	T = read_int()
	for _ in range(T):
		N = read_int()
		print(slv(N))
main()


t = int(input())
for i in range(t):
	n = int(input())
	if n == 1:
		print(-1)
	else:
		x = ['7'] * (n - 1)
		x += ['8']
		print(''.join(x))


import sys
import math
import heapq
import collections

def inputnum():
	return int(input())

def inputnums():
	return map(int, input().split())

def inputlist():
	return list(map(int, input().split()))

def inputstring():
	return [x for x in input()]

def inputmatrixchar(rows):
	arr2d = [[j for j in input().strip()] for i in range(rows)]
	return arr2d

def inputmatrixint(rows):
	arr2d = []
	for _ in range(rows):
		arr2d.append([int(i) for i in input().split()])
	return arr2d
t = int(input())
for q in range(t):
	n = inputnum()
	if n == 1:
		print(-1)
		continue
	rtn = ['2'] * n
	if (n - 1) % 3 == 0:
		rtn[n - 2] = '3'
	rtn[n - 1] = '3'
	for i in range(n):
		print(rtn[i], end='')
	print()


def func(n):
	if n == 1:
		print('-1')
		return
	n5 = n - 1
	n2 = 0
	if n5 % 3 == 0:
		n2 = 1
		n5 -= 1
	for _ in range(n5):
		print('5', end='')
	print('7', end='3\n') if n2 == 1 else print('3')
	return
t = int(input())
while t != 0:
	n = int(input())
	func(n)
	t -= 1


import io, os
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
t = int(input())
for i in range(t):
	n = int(input())
	if n == 1:
		print(-1)
	elif (n - 1) % 3 == 0:
		ans = []
		for j in range(n - 2):
			ans.append(8)
		ans.append(4)
		ans.append(3)
		print(''.join((str(x) for x in ans)))
	else:
		ans = []
		for j in range(n - 1):
			ans.append(8)
		ans.append(3)
		print(''.join((str(x) for x in ans)))


def main():
	import sys
	input = sys.stdin.readline
	for _ in range(int(input())):
		N = int(input())
		if N == 1:
			print(-1)
		else:
			ans = ['3'] * N
			ans[0] = '2'
			print(''.join(ans))
main()


n = int(input())
for j in range(n):
	a = 0
	a = int(input())
	if a != 1:
		print(2, end='')
		for i in range(a - 1):
			print(3, end='')
		print('\n')
	else:
		print(-1)


def func(n):
	if n == 1:
		return '-1'
	if (n - 1) % 3 == 0:
		return (n - 2) * '2' + '33'
	else:
		return (n - 1) * '2' + '3'
t = int(input())
l = []
for i in range(t):
	l.append(func(int(input())))
for i in range(t):
	print(l[i])


t = int(input())
for x in range(1, t + 1):
	n = int(input())
	if n == 1:
		print('-1')
	else:
		for i in range(0, n):
			if i == 0:
				print(5, end='')
			else:
				print(3, end='')
		print()


T = int(input())
for t in range(T):
	n = int(input())
	ans = -1
	if n > 1:
		ans = '2' + '7' * (n - 1) if 7 * (n - 1) % 3 == 0 else '7' * (n - 1) + '3'
	print(ans)


for i in range(int(input())):
	n = int(input())
	if n == 1:
		print('-1')
	elif n == 2:
		print('57')
	else:
		print(str((n - 2) * '7') + '8' + '7')


import sys
import math
import os
import itertools
import string
import heapq
import _collections
from collections import Counter
from collections import defaultdict
from functools import lru_cache
import bisect
import re
import queue
from decimal import *

class Scanner:

	@staticmethod
	def int():
		return int(sys.stdin.readline().rstrip())

	@staticmethod
	def string():
		return sys.stdin.readline().rstrip()

	@staticmethod
	def map_int():
		return [int(x) for x in Scanner.string().split()]

	@staticmethod
	def string_list(n):
		return [input() for i in range(n)]

	@staticmethod
	def int_list_list(n):
		return [Scanner.map_int() for i in range(n)]

	@staticmethod
	def int_cols_list(n):
		return [int(input()) for i in range(n)]

class Math:

	@staticmethod
	def gcd(a, b):
		if b == 0:
			return a
		return Math.gcd(b, a % b)

	@staticmethod
	def lcm(a, b):
		return a * b // Math.gcd(a, b)

	@staticmethod
	def divisor(n):
		res = []
		i = 1
		for i in range(1, int(n ** 0.5) + 1):
			if n % i == 0:
				res.append(i)
				if i != n // i:
					res.append(n // i)
		return res

	@staticmethod
	def round_up(a, b):
		return -(-a // b)

	@staticmethod
	def is_prime(n):
		if n < 2:
			return False
		if n == 2:
			return True
		if n % 2 == 0:
			return False
		d = int(n ** 0.5) + 1
		for i in range(3, d + 1, 2):
			if n % i == 0:
				return False
		return True

class PriorityQueue:

	def __init__(self, l=[]):
		self.q = l
		heapq.heapify(self.q)
		return

	def push(self, n):
		heapq.heappush(self.q, n)
		return

	def pop(self):
		return heapq.heappop(self.q)

def pop_count(x):
	x = x - (x >> 1 & 6148914691236517205)
	x = (x & 3689348814741910323) + (x >> 2 & 3689348814741910323)
	x = x + (x >> 4) & 1085102592571150095
	x = x + (x >> 8)
	x = x + (x >> 16)
	x = x + (x >> 32)
	return x & 127
MOD = int(1000000000.0) + 7
INF = int(1000000000000000.0)

def main():
	T = Scanner.int()
	for _ in range(T):
		N = Scanner.int()
		if N == 1:
			print(-1)
			continue
		print('2' + '3' * (N - 1))
main()


from collections import deque
from collections import Counter
from itertools import permutations
import heapq

def counterExample():
	arr = [1, 3, 4, 1, 2, 1, 1, 3, 4, 3, 5, 1, 2, 5, 3, 4, 5]
	counter = Counter(arr)
	top_three = counter.most_common(3)
	print(top_three)
q = deque()

def main():
	t = int(input())
	while t >= 1:
		n = int(input())
		if n == 1:
			print('-1')
		elif n % 3 != 1:
			print('2' * (n - 1) + '3')
		else:
			print('2' * (n - 2) + '4' + '3')
		t -= 1
main()


t = int(input())
for _ in range(t):
	n = int(input())
	if n == 1:
		print(-1)
	elif (n - 1) % 3 == 0:
		for i in range(n - 2):
			print(2, end='')
		print(43)
	else:
		for i in range(n - 1):
			print(2, end='')
		print(3)


t = int(input())
x = '2'
for i in range(t):
	n = int(input())
	x = '2'
	z = False
	if n == 1:
		print('-1')
	else:
		for j in range(n - 1):
			x = x + '3'
		print(int(x))


def solve():
	n = int(input())
	return '5' + '3' * (n - 1) if n > 1 else -1
[print(solve()) for _ in range(int(input()))]


from sys import stdin as s
for i in range(int(s.readline())):
	n = int(s.readline())
	if n == 1:
		print(-1)
	elif n % 18 == 1:
		print('2' * (n - 2) + '33')
	elif n % 6 == 1:
		print('2' * (n - 1) + '9')
	else:
		print('2' * (n - 1) + '7')


t = int(input())
for i in range(t):
	n = int(input())
	if n < 2:
		print(-1)
	elif (n - 1) % 9 == 0:
		print('8' * (n - 2) + '99')
	else:
		print('8' * (n - 1) + '9')


t = int(input())
for _ in range(t):
	n = int(input())
	if n == 1:
		print(-1)
	elif n % 3 == 0 or n % 3 == 2:
		cislo = (n - 1) * ['2']
		cislo = cislo + ['3']
		print(''.join((x for x in cislo)))
	else:
		cislo = (n - 1) * ['3']
		cislo = ['2'] + cislo
		print(''.join((x for x in cislo)))


import math
t = int(input())
list = []
for n in range(1, t + 1):
	a = input()
	a = int(a)
	if a == 1:
		list.append(-1)
	elif a % 3 == 0 or a % 3 == 1:
		list.append((a - 2) * '2' + '33')
	elif a % 3 == 2:
		list.append((a - 1) * '2' + '3')
for n in list:
	print(n)


for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print(-1)
	else:
		a = 10 ** (n - 1)
		b = '9' * (n - 1) + '7'
		i = int(b)
		while i > a:
			cnt = 1
			div = 0
			if cnt % 2 != 0:
				intv = int(i)
				if intv % 3 == 0 or intv % 7 == 0 or intv % 9 == 0:
					div = 1
				if div == 0:
					print(intv)
					break
				else:
					i = intv - 4
				cnt += 1
			elif cnt % 2 == 0:
				intv = int(i)
				if intv % 3 == 0 or intv % 7 == 0 or intv % 9 == 0:
					div = 1
				if div == 0:
					print(intv)
					break
				else:
					i = intv - 6
				cnt += 1


import sys
import os
from io import IOBase, BytesIO
import math
mod = 10 ** 9 + 7
pie = 3.1415926536

def modinv(n, p):
	return pow(n, p - 2, p)

def ncr(n, r, p):
	t = fact[n] * (ifact[r] * ifact[n - r] % p) % p
	return t

def ain():
	return list(map(int, sin().split()))

def sin():
	return input().strip()

def GCD(x, y):
	while y:
		(x, y) = (y, x % y)
	return x

def read2DIntArray(row, col):
	arr = []
	for i in range(0, row):
		temp = list(map(int, sin().split()))
		arr.append(temp)
	return arr

def read2DCharArray(row, col):
	arr = []
	for i in range(0, row):
		temp = str(sin())
		arr.append(temp)
	return arr

def smallestNumber(n):
	lst = list(str(n))
	lst.sort()
	tmp = ''
	for (i, n) in enumerate(lst):
		if n != '0':
			tmp = lst.pop(i)
			break
	return str(tmp) + ''.join(lst)

def main():
	t = int(sin())
	lst = []
	for i in range(t):
		lst.append(int(sin()))
	for d in lst:
		if d == 1:
			print('-1', end='')
		else:
			print('2', end='')
			d -= 1
			while d > 0:
				print('3', end='')
				d -= 1
		print('')
py2 = round(0.5)
if py2:
	from future_builtins import ascii, filter, hex, map, oct, zip
	range = xrange
BUFSIZE = 8192

class FastIO(BytesIO):
	newlines = 0

	def __init__(self, file):
		self._file = file
		self._fd = file.fileno()
		self.writable = 'x' in file.mode or 'w' in file.mode
		self.write = super(FastIO, self).write if self.writable else None

	def _fill(self):
		s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
		self.seek((self.tell(), self.seek(0, 2), super(FastIO, self).write(s))[0])
		return s

	def read(self):
		while self._fill():
			pass
		return super(FastIO, self).read()

	def readline(self):
		while self.newlines == 0:
			s = self._fill()
			self.newlines = s.count(b'\n') + (not s)
		self.newlines -= 1
		return super(FastIO, self).readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.getvalue())
			(self.truncate(0), self.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		if py2:
			self.write = self.buffer.write
			self.read = self.buffer.read
			self.readline = self.buffer.readline
		else:
			self.write = lambda s: self.buffer.write(s.encode('ascii'))
			self.read = lambda : self.buffer.read().decode('ascii')
			self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))

def input():
	return sys.stdin.readline().rstrip('\r\n')
main()


from math import sqrt
t = int(input())
while t:
	t = t - 1
	n = int(input())
	if n == 1:
		print(-1)
		continue
	for i in range(n):
		if i == 0:
			print(2, end='')
		else:
			print(3, end='')
	print()


n = int(input())
for i in range(n):
	k = int(input())
	if k == 1:
		print(-1)
	else:
		print(3 * 10 ** (k - 1) - 1)


t = int(input())
for i in range(t):
	n = int(input())
	if n == 1:
		print(-1)
	else:
		s = '3' * (n - 1) + '8'
		print(int(s))


t = int(input())
for i in range(t):
	n = int(input())
	if n == 1:
		print(-1)
	else:
		l = []
		l.append('4')
		for j in range(n - 1):
			l.append('3')
		s = ''.join(l)
		print(int(s))


t = int(input())
for _ in range(t):
	n = int(input())
	if n == 1:
		print(-1)
	else:
		k = 2 * (n - 1) + 3
		if k % 3 == 0:
			print('2' * (n - 2) + '33')
		else:
			print('2' * (n - 1) + '3')


import collections

def solve(n):
	if n == 1:
		return -1
	ans = [2]
	for i in range(1, n):
		ans.append(3)
	return ''.join(map(str, ans))
t = int(input().strip())
for i in range(t):
	n = int(input().strip())
	print(solve(n))


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print(-1)
		continue
	ans = '9' * (n - 1) + '4'
	print(int(ans))


for _ in range(int(input())):
	n = int(input())
	s = ''
	if n == 1:
		print('-1')
		continue
	w = 2
	s += str(w)
	w = 3
	for i in range(n - 2):
		s += str(w)
	s += '9'
	print(s)


for i in ' ' * int(input()):
	n = int(input())
	if n == 1:
		print(-1)
	elif n % 3 != 1:
		print('2' * (n - 1) + '3')
	else:
		print('2' * (n - 2) + '77')


t = int(input())
for i in range(t):
	a = int(input())
	if a == 1:
		print(-1)
	elif a == 2:
		print(23)
	else:
		s = '2' + '3' * (a - 1)
		print(s)


t = int(input())
for loop in range(t):
	n = int(input())
	if n == 1:
		print(-1)
		continue
	ans = ['2'] * n
	ans[-1] = '3'
	if (n - 1) % 3 == 0:
		ans[-2] = '3'
	print(''.join(ans))


t_cases = int(input())
cases = []
for i in range(t_cases):
	num = int(input())
	cases.append(num)

def verify_case(case):
	if case == 1:
		print(-1)
	else:
		print(int('9' * case) - 1)
for i in range(t_cases):
	verify_case(cases[i])


def solve(n):
	start = int('2' * n)
	for i in range(start, start + 8):
		if i % 2 == 0 or i % (i % 10) == 0:
			continue
		return i
	start = int('2' + '3' * (n - 1))
	for i in range(start, start + 8):
		if i % 2 == 0 or i % (i % 10) == 0:
			continue
		return i
for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print(-1)
	else:
		print(solve(n))


for tc in range(int(input())):
	n = int(input())
	if n == 1:
		print(-1)
	else:
		a = '5' * (n - 1) + '4'
		print(a)


tc = int(input())
while tc:
	n = int(input())
	print(-1) if n == 1 else print('7' * (n - 1) + '4')
	tc -= 1


from sys import stdin, stdout
cin = stdin.readline
cout = stdout.write
mp = lambda : list(map(int, cin().split()))
(t,) = mp()
for _ in range(t):
	(n,) = mp()
	if n > 1:
		s = '5' * (n - 1) + '4\n'
		cout(s)
	else:
		cout('-1\n')


T = int(input().rstrip())

def solve(x):
	if x == 1:
		return -1
	if x == 2:
		return 53
	str = '3' * (x - 2)
	str += '53'
	return str
for test in range(T):
	x = int(input().rstrip())
	res = solve(x)
	print(res)


t = int(input())
for T in range(t):
	n = int(input())
	if n == 1:
		print(-1)
	else:
		print(2, sep='', end='')
		for i in range(n - 1):
			print(3, sep='', end='')
		print('')


t = int(input())
for k in range(t):
	n = int(input())
	if n == 1:
		print('-1')
	else:
		ans = '5'
		for i in range(n - 1):
			ans += '7'
		print(ans)


import sys
input = lambda : sys.stdin.readline().rstrip()
for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print(-1)
	else:
		print('9' * (n - 1) + '4')


for nt in range(int(input())):
	n = int(input())
	if n == 1:
		print(-1)
		continue
	ans = '3'
	s = 3
	for i in range(n - 2):
		ans += '2'
		s += 2
	if (s + 2) % 3 == 0:
		ans += '4'
	else:
		ans += '2'
	print(ans[::-1])


t = int(input())
for i in range(1, t + 1):
	n = int(input())
	if n == 1:
		print('-1')
		continue
	for j in range(n - 1):
		print('5', end='')
	print('4')


def solve():
	n = int(input())
	if n == 1:
		print(-1)
		return
	else:
		print('2' + '3' * (n - 1))
t = int(input())
for x in range(t):
	solve()


from sys import stdout
t = int(input())
for _ in range(t):
	n = int(input())
	if n == 1:
		stdout.write('-1')
	else:
		stdout.write('76')
		stdout.write('7' * (n - 2))
	stdout.write('\n')


def checker(x):
	if x == 1:
		return -1
	return '2' + '3' * (x - 1)
for _ in range(int(input())):
	print(checker(int(input())))


for _ in range(int(input())):
	t = int(input())
	if t == 1:
		print(-1)
	else:
		print('2', '3' * (t - 1), sep='')


def f1():
	T = int(input())
	for i in range(0, T):
		t = int(input())
		if t == 1:
			print(-1)
			continue
		intx = ''
		for k in range(t - 1):
			intx = intx + '7'
		intx = int(intx)
		for j in range(3, 10):
			if j != 7:
				a = (intx * 10 + j) % 7
				b = (intx * 10 + j) % j
				if a != 0 and b != 0:
					num = intx * 10 + j
					print(num)
					break

def f2():
	pass

def f3():
	pass
f1()


def ugly(n):
	if n == 1:
		return -1
	else:
		return '2' + '7' * (n - 1)
t = int(input())
a = []
for x in range(t):
	a.append(int(input()))
for y in a:
	print(ugly(y))


import sys
t = int(sys.stdin.readline())
for _ in range(t):
	n = int(sys.stdin.readline())
	if n == 1:
		print(-1)
		continue
	l = [3 for _ in range(n)]
	s = sum(l)
	if s % 3 != 0:
		pass
	else:
		for i in range(2, 10):
			if (s + i - 3) % 3 != 0:
				l[0] = i
				break
	print(''.join((str(x) for x in l)))


from sys import stdin, stdout
from collections import Counter

def ai():
	return list(map(int, stdin.readline().split()))

def ei():
	return map(int, stdin.readline().split())

def ip():
	return int(stdin.readline().strip())

def op(ans):
	return stdout.write(str(ans) + '\n')
for i in range(ip()):
	n = ip()
	if n == 1:
		print(-1)
	else:
		x = ['2'] + ['3'] * (n - 1)
		print(''.join(x))


def R():
	return map(int, input().split())

def I():
	return int(input())

def S():
	return str(input())

def L():
	return list(R())
from collections import Counter
import math
import sys
from itertools import permutations
import bisect
for _ in range(I()):
	n = I()
	if n == 1:
		print('-1')
	else:
		print('2' + '3' * (n - 1))


test_cases = int(input().strip())

def testCase():
	n = int(input().strip())
	print('2' + (n - 1) * '3' if n > 1 else '-1')
for t in range(test_cases):
	testCase()


q = int(input())
for i in range(q):
	n = int(input())
	if n == 1:
		print(-1)
	elif (n - 1) * 2 % 3 == 0:
		print('2' * (n - 2) + '4' + '3')
	else:
		print('2' * (n - 1) + '3')


from sys import stdin
input = stdin.buffer.readline
for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print(-1)
	elif (n - 1) % 3:
		print('2' * (n - 1) + '3')
	else:
		print('2' * (n - 2) + '33')


for i in range(int(input())):
	a = int(input())
	if a == 1:
		print(-1)
	elif (a - 1) % 3 == 0:
		print('2' * (a - 2) + '33')
	else:
		print('2' * (a - 1) + '3')


for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print(-1)
		continue
	s = '2'
	for i in range(n - 1):
		s += '3'
	print(s)


t = int(input())
for inh in range(0, t):
	n = int(input())
	if n == 1:
		print(-1)
	else:
		s = '4' + '3' * (n - 1)
		print(s)


from sys import stdin
from collections import defaultdict, Counter
from math import gcd
T = int(input())
for _ in range(T):
	(n,) = map(int, stdin.readline().split())
	if n == 1:
		print(-1)
	else:
		print('8' + '7' * (n - 1))


t = int(input())
for you in range(t):
	n = int(input())
	if n == 1:
		print(-1)
	else:
		for i in range(n - 1):
			print(3, end='')
		print(8)


for i in [0] * int(input()):
	b = int(input())
	a = '8' * (b - 1) + '7' if b > 1 else -1
	a = int(a)
	print(a - 10 if a % 7 == 0 else a)


for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print(-1)
	else:
		while True:
			print('3', end='')
			n -= 1
			if n == 1:
				break
		print('4')


import sys, math
input = sys.stdin.readline

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return s[:len(s) - 1]

def invr():
	return map(int, input().split())
t = 1
t = inp()
for tt in range(t):
	n = inp()
	if n == 1:
		print(-1)
	elif n == 2:
		print(23)
	elif (5 + 3 * (n - 1)) % 3 == 0:
		print('5' + '3' * (n - 1))
	else:
		print('55' + '3' * (n - 2))


t = int(input())
while t > 0:
	t -= 1
	n = int(input())
	if n == 1:
		print(-1)
	else:
		a = '3' * (n - 1)
		a = a + '4'
		print(a)


T = int(input())
for i in range(T):
	N = int(input())
	if N == 1:
		print(-1)
		continue
	result = '2'
	for i in range(N - 1):
		result += '3'
	print(result)


for _ in range(int(input())):
	n = int(input())
	ans = '-1'
	if n > 1:
		ans = ''
		if (n - 1) % 3 == 0:
			ans += '2' * (n - 2)
			ans += '4'
		else:
			ans += '2' * (n - 1)
		ans += '3'
	print(ans)


from sys import stdin, stdout
for i in range(int(input())):
	n = int(input())
	if n == 1:
		print(-1)
	elif int((n - 1) * '2' + '3') % 3 != 0:
		stdout.write((n - 1) * '2' + '3')
		print()
	elif int((n - 2) * '2' + '33') % 3 != 0:
		stdout.write((n - 2) * '2' + '33')
		print()
	elif int((n - 3) * 2 + '333') % 3 != 0:
		stdout.write((n - 3) * '2' + '333')
		print()


for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print(-1)
	else:
		l = [2 for _ in range(n - 1)]
		if 2 * (n - 1) % 3 == 0:
			l.pop()
			l.append(4)
			l.append(3)
		else:
			l.append(3)
		for i in l:
			print(i, end='')
		print()


import sys
t = int(sys.stdin.readline())
ans_arr = []
for i in range(t):
	n = int(sys.stdin.readline())
	if n == 1:
		ans_arr.append(str(-1))
	else:
		s = '2'
		s += '7' * (n - 1)
		ans_arr.append(s)
print('\n'.join(ans_arr))


def ProcessInputs():
	N = int(input())
	if N == 1:
		print(-1)
	else:
		print('2' + '3' * (N - 1))
T = int(input())
for _ in range(T):
	ProcessInputs()


t = int(input())
for test in range(t):
	n = int(input())
	if n == 1:
		print('-1')
		continue
	print('2', end='')
	for i in range(n - 1):
		print('3', end='')
	print()


t = input()
t = int(t)
for i in range(t):
	n = input()
	n = int(n)
	if n is 1:
		print('-1', end='')
	else:
		for j in range(n):
			if j is 0:
				print('2', end='')
			else:
				print('3', end='')
	print()


T = 1
T = int(input())
for t in range(1, T + 1):
	n = int(input())
	if n == 1:
		print(-1)
		continue
	if 2 * (n - 1) % 3 != 0:
		print('2' * (n - 1) + '3')
	else:
		print('2' * (n - 2) + '3' * 2)


num_inp = lambda : int(input())
arr_inp = lambda : list(map(int, input().split()))
for _ in range(int(input())):
	n = int(input())
	print('2' + (n - 1) * '3' if n != 1 else '-1')
sp_inp = lambda : map(int, input().split())
str_inp = lambda : input()


t = int(input())
l = 3
while t > 0:
	n = int(input())
	if n == 1:
		print(-1)
	elif n == 2:
		print(57)
	elif n == 3:
		print(239)
	else:
		s = ''
		if (n - 1) % 8 == 0:
			for i in range(n - 2):
				s = s + '7'
			s = s + '88'
		else:
			for i in range(n - 1):
				s = s + '7'
			s = s + '8'
		print(s)
	t -= 1


for _ in range(int(input())):
	x = int(input())
	d = str(3)
	if x == 1:
		print('-1')
	else:
		d = d * (x - 1)
		print(d + str(4))


t = int(input())
while t:
	t += -1
	n = int(input())
	if n == 1:
		print(-1)
	else:
		k = n - 1
		if 2 * (n - 1) % 3 == 0:
			k = n - 2
		a = int('2' * k)
		if k == n - 1:
			print(a, '3', sep='')
		else:
			print(a, '33', sep='')


t = int(input())
for i in range(t):
	n = int(input())
	s = ''
	if n == 1:
		print(-1)
		continue
	s = '5' * (n - 1) + '4'
	print(s)


for q in range(int(input())):
	n = int(input())
	if n == 1:
		print(-1)
	elif n % 3 != 1:
		print('2' * (n - 1) + '3')
	else:
		print('2' * (n - 2) + '43')


import sys
input = sys.stdin.readline
t = int(input())
for i in range(t):
	n = int(input())
	if n == 1:
		print(-1)
		continue
	res = '2' + ''.join(['3' for i in range(n - 1)])
	print(res)


t = int(input())
for j in range(t):
	n = int(input())
	if n == 1:
		print(-1)
		continue
	print(10 ** n - 2)


test_cases = int(input())
inputs = []
for i in range(test_cases):
	s = int(input())
	inputs.append(s)
for i in inputs:
	if i == 1:
		print(-1)
	elif i > 1:
		print(int('7' * i) + 1)


def solve(n):
	if n == 1:
		print(-1)
		return
	print(2, end='')
	print('3' * (n - 1))
t = int(input())
for _ in range(t):
	n = int(input())
	solve(n)


tc = int(input().strip())
for _ in range(tc):
	n = int(input().strip())
	if n == 1:
		print('-1')
	else:
		if (n - 1) % 3 == 0:
			s = '5' * (n - 2) + '3' * 2
		else:
			s = '5' * (n - 1) + '3'
		print(s)


import sys
input = sys.stdin.readline
T = int(input())
for _ in range(T):
	n = int(input())
	if n == 1:
		print(-1)
	elif (2 * (n - 1) + 3) % 3 == 0:
		print('2' * (n - 2) + '3' * 2)
	else:
		print('2' * (n - 1) + '3')


def func(n):
	if n == 1:
		return -1
	elif n == 2:
		return 23
	elif n == 3:
		return 239
	elif n == 4:
		return 2299
	else:
		s = 2299 * 10 ** (n - 4) + 10 ** (n - 4) - 1
		return s
t = int(input())
for _ in range(t):
	n = int(input())
	print(func(n))


for i in range(int(input())):
	n = int(input())
	if n == 1:
		answer = -1
	elif n % 3 == 1 and n != 1:
		string = (n - 2) * '2' + '33'
		answer = int(string)
	else:
		string = (n - 1) * '2' + '3'
		answer = int(string)
	print(answer)


a = int(input())
r = 0
c = list()
while r < a:
	b = int(input())
	if b == 1:
		c.append('-1')
	elif b == 2:
		c.append('23')
	else:
		s = 0
		t = '23'
		while s < b - 2:
			t = t + '3'
			s = s + 1
		c.append(t)
	r = r + 1
r = 0
while r < a:
	print(c[r])
	r = r + 1


for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print(-1)
		continue
	else:
		s = ['3'] * n
		s[0] = '2'
		print(''.join(s))


kt = int(input())
for t in range(kt):
	n = int(input())
	if n == 1:
		print(-1)
		continue
	answer = [2 for i in range(n)]
	summa = 2 * n + 1
	answer[-1] = 3
	if summa % 3 == 0:
		answer[0] = 3
	for i in range(len(answer)):
		print(answer[i], end='')
	print()


from sys import stdin, stdout
for tc_ in range(int(stdin.readline())):
	n = int(stdin.readline())
	if n == 1:
		stdout.writelines('-1\n')
	elif (n - 1) % 9 == 0:
		stdout.writelines('2' * (n - 2) + '49\n')
	else:
		stdout.writelines('2' * (n - 1) + '9\n')


import sys

def main():

	def GCD(x, y):
		while y:
			(x, y) = (y, x % y)
		return x

	def lcm(a, b):
		return a * b // GCD(a, b)

	def merge(a, start, mid, end, d):
		p = start
		q = mid + 1
		arr = [0] * (end - start + 1)
		k = 0
		coun = 0
		for i in range(start, end + 1):
			if p > mid:
				arr[k] = a[q]
				q += 1
				k += 1
			elif q > end:
				arr[k] = a[p]
				d[a[p]] += coun
				k += 1
				p += 1
			elif a[p] < a[q]:
				arr[k] = a[p]
				d[a[p]] += coun
				k += 1
				p += 1
			else:
				arr[k] = a[q]
				k += 1
				q += 1
				coun += 1
		for i in range(k):
			a[start] = arr[i]
			start += 1

	def mergesort(a, start, end, d):
		if start < end:
			mid = (start + end) // 2
			mergesort(a, start, mid, d)
			mergesort(a, mid + 1, end, d)
			merge(a, start, mid, end, d)

	def inversion(l):
		d = {}
		for i in l:
			d[i] = 0
		mergesort(l, 0, len(l) - 1, d)
		return d

	def binary_search_lower(A, low, high, k):
		if high - low != 1:
			mid = (low + high) // 2
			x = A[mid]
			if x >= k:
				return binary_search_lower(A, low, mid, k)
			else:
				return binary_search_lower(A, mid, high, k)
		if A[low] >= k:
			return low
		else:
			return high

	def binary_expo(x, n):
		if n == 0:
			return 1
		elif n % 2 == 0:
			return binary_expo(x * x, n // 2)
		else:
			return x * binary_expo(x * x, (n - 1) // 2)

	def modu_expo(x, n, m):
		if n == 0:
			return 1
		elif n % 2 == 0:
			return modu_expo(x * x % m, n // 2, m)
		else:
			return x * modu_expo(x * x % m, (n - 1) // 2, m) % m

	def eEuclid(c, m):
		if m == 0:
			global d
			global x
			global y
			d = c
			x = 1
			y = 0
		else:
			eEuclid(m, c % m)
			temp = x
			x = y
			y = temp - c // m * y

	def mod_Inv(c, m):
		eEuclid(c, m)
		return (x % m + m) % m

	def ncr(n, r, p):
		num = den = 1
		for i in range(r):
			num = num * (n - i) % p
			den = den * (i + 1) % p
		return num * pow(den, p - 2, p) % p
	for _ in range(int(sys.stdin.readline())):
		n = int(sys.stdin.readline())
		if n == 1:
			print(-1)
		else:
			print(2, end='')
			for i in range(n - 1):
				print(3, end='')
		print()
main()


def solve():
	n = int(input().strip())
	if n == 1:
		print(-1)
	else:
		ans = '2' * (n - 1) + '3'
		if (n - 1) % 3 == 0:
			ans = ans[:-2] + '33'
		print(ans)

def main():
	tc = int(input().strip())
	for case in range(tc):
		solve()
main()


t = int(input())
while t:
	n = int(input())
	if n == 1:
		print('-1')
	else:
		print('6' + '7' * (n - 1))
	t -= 1


n = int(input())
for _ in range(n):
	x = int(input())
	if x == 1:
		print(-1)
		continue
	print(2, end='')
	for _ in range(x - 1):
		print(3, end='')
	print()


n = int(input())
for i in range(n):
	t = int(input())
	if t == 1:
		print(-1)
	else:
		for j in range(t - 1):
			print(7, end='')
		print(8)


import sys
input = sys.stdin.readline

def multi_input():
	return map(int, input().split())

def array_print(arr):
	print(' '.join(map(str, arr)))
for t in range(int(input())):
	n = int(input())
	if n == 1:
		print(-1)
	elif int('9' * (n - 1) + '7') % 7 != 0:
		print('9' * (n - 1) + '7')
	elif int('9' * (n - 1) + '8') % 8 != 0:
		print('9' * (n - 1) + '8')


def ans(n):
	if n == 1:
		return -1
	if (n - 1) % 3 != 0:
		return '2' * (n - 1) + '3'
	return '2' * (n - 2) + '33'
T = int(input())
for _ in range(T):
	n = int(input())
	print(ans(n))


a = int(input())
for i in range(a):
	k = int(input())
	if k == 1:
		print(-1)
	elif k % 3 == 1:
		print('2' * (k - 2) + '4' + '3')
	else:
		print('2' * (k - 1) + '3')


import math

def solve():
	n = int(input())
	if n == 1:
		print(-1)
	else:
		print('6' + '7' * (n - 1))
t = int(input())
for i in range(t):
	solve()


t = int(input())
for r in range(t):
	n = int(input())
	if n == 1:
		print(-1)
	else:
		s = '9' * (n - 1)
		s = s + '8'
		print(s)


for _ in range(int(input())):
	n = int(input())
	l = []
	if n == 1:
		print('-1')
	else:
		for i in range(n):
			if i == 0:
				l.append('2')
			else:
				l.append('3')
		str1 = ''
		print(str1.join(l))


def get_s(n):
	if n == 1:
		return -1
	res = '5' * (n - 1) + '3'
	if int(res) % 3 == 0:
		res = '3' + res[1:]
	return res
t = int(input())
for _ in range(t):
	n = int(input())
	print(get_s(n))


t = int(input())
for _ in range(t):
	x = int(input())
	if x == 1:
		print(-1)
		continue
	s = ''
	while len(s) < x - 1:
		s += '3'
	print(s + '4')


def checkNo(s):
	n = int(s)
	for i in s:
		if n % int(i) == 0:
			return False
	return True
for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print('-1')
	elif n == 2:
		print(23)
	else:
		for i in range(1, n - 1):
			s = ''
			s += '2' * (n - i)
			s += '3' * i
			if checkNo(s):
				print(s)
				break


for n in range(int(input())):
	s = int(input())
	if s == 1:
		print(-1)
	else:
		print(10 ** s - 2)


q = int(input())
for _ in range(q):
	num = int(input())
	if num == 1:
		print(-1)
	else:
		print('5' * (num - 1) + '4')


T = int(input())
for i in range(T):
	N = int(input())
	if N == 1:
		print(-1)
		continue
	result = '5'
	for i in range(N - 1):
		result += '7'
	print(result)


t = int(input())
for i in range(t):
	x = int(input())
	if x == 1:
		print(-1)
		continue
	if (x - 1) % 3 == 0:
		s = '2' * (x - 2) + '33'
	else:
		s = '2' * (x - 1) + '3'
	print(s)


for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print(-1)
	elif n == 2:
		print('23')
	elif n == 3:
		print('239')
	elif n == 4:
		print('2393')
	elif n == 5:
		print('23939')
	else:
		x = ['2', '3', '9', '3']
		for j in range(4, n - 1):
			x.append('9')
		x.append('3')
		print(''.join(x))


import sys
reader = (s.rstrip() for s in sys.stdin)
input = reader.__next__

def gift():
	for _ in range(t):
		num = int(input())
		if num == 1:
			yield (-1)
		else:
			yield ((num - 2) * '9' + '23')
t = int(input())
ans = gift()
print(*ans, sep='\n')


t = int(input().strip())
for _ in range(t):
	n = int(input().strip())
	if n == 1:
		print(-1)
	else:
		print('2' + ''.join(('7' for i in range(n - 1))))


from random import randint
for i in range(int(input())):
	n = int(input())
	print('2' + '3' * (n - 1) if n != 1 else -1)


for i in range(int(input())):
	a = int(input())
	sum = 0
	if a == 1:
		print(-1)
		continue
	s = str(2)
	s1 = str(3)
	s1 *= a - 1
	s += s1
	print(int(s))


t = input()
nums = []
for i in range(int(t)):
	nums.append(input())
for i in range(int(t)):
	n = int(nums[i])
	summ = 0
	if n == 1:
		print('-1')
	else:
		for j in range(n - 2):
			print('2', end='')
			summ += 2
		if (summ + 2 + 3) % 3 == 0:
			print('4', end='')
		else:
			print('2', end='')
		print('3')


for x in range(int(input())):
	a = int(input())
	if a == 1:
		print(-1)
	else:
		print(str(2) + str(3) * (a - 1))


def find_number(digits):
	string = ''
	if (digits - 1) % 3 == 0:
		for i in range(digits - 2):
			string += '2'
		string += '33'
	else:
		for i in range(digits - 1):
			string += '2'
		string += '3'
	return int(string)
t = int(input())
for i in range(t):
	n = int(input())
	if n <= 1:
		print(-1)
	else:
		print(find_number(n))


a = int(input())
for j in range(a):
	n = int(input())
	b = str()
	if n == 1:
		print(-1)
		continue
	else:
		for i in range(1, n + 1):
			if i == n:
				print(3)
				break
			if i == 1:
				print(2, end='')
			else:
				print(3, end='')


n = int(input())
while n > 0:
	nu = int(input())
	if nu == 1:
		print('-1')
	else:
		print('2', end='')
		for i in range(nu - 1):
			print('9', end='')
		print()
	n -= 1


def f(n):
	if n == 1:
		return -1
	x = int('2' * (n - 1) + '0')
	if (x + 3) % 3:
		return x + 3
	if (x + 7) % 7:
		return x + 7
	if (x + 9) % 9:
		return x + 9
	if (x + 13) % 3:
		return x + 13
	return -1
for _ in range(int(input())):
	print(f(int(input())))


for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print(-1)
	else:
		if (n - 1) % 3 != 0:
			s = '2' * (n - 1) + '3'
		else:
			s = '2' * (n - 2) + '43'
		print(int(s))


def ma(a):
	if a <= 1:
		return -1
	m = ''
	for r in range(a - 1):
		m += '2'
	m += '3'
	if int(m) % 3 == 0:
		m = m[:a - 2]
		m += '3'
		m += '3'
	return m
	return result
a = int(input())
for r in range(a):
	x = int(input())
	m = ma(x)
	print(m)


for _ in range(int(input())):
	n = int(input())
	ans = ['2'] * (n - 1) + ['3']
	if (2 * (n - 1) + 3) % 3 == 0:
		ans[0] = '3'
	if n == 1:
		print(-1)
		continue
	print(''.join(ans))


t = int(input())
for i in range(t):
	n = int(input())
	if n == 1:
		print('-1')
		continue
	p = 2 * (n - 1) + 3
	if p % 2 == 0 and p % 3 == 0:
		a = ''
		for i in range(n - 1):
			a = a + '2'
		a = a + '3'
		print(a)
	else:
		a = ''
		a = a + '2'
		for i in range(n - 1):
			a = a + '3'
		print(a)


def main():
	for i in [0] * int(input()):
		x = int(input())
		print([-1, '4' + (x - 1) * '7'][x > 1])
main()


import sys
stdin = sys.stdin
inf = 1 << 60
mod = 1000000007
ni = lambda : int(ns())
nin = lambda y: [ni() for _ in range(y)]
na = lambda : list(map(int, stdin.readline().split()))
nan = lambda y: [na() for _ in range(y)]
nf = lambda : float(ns())
nfn = lambda y: [nf() for _ in range(y)]
nfa = lambda : list(map(float, stdin.readline().split()))
nfan = lambda y: [nfa() for _ in range(y)]
ns = lambda : stdin.readline().rstrip()
nsn = lambda y: [ns() for _ in range(y)]
ncl = lambda y: [list(ns()) for _ in range(y)]
nas = lambda : stdin.readline().split()
t = ni()

def sol():
	n = ni()
	if n == 1:
		print(-1)
		return
	print(2, end='')
	for _ in range(n - 1):
		print(3, end='')
	print()

def main():
	for _ in range(t):
		sol()
main()


from collections import deque
t = int(input())
for i in range(t):
	n = int(input())
	if n == 1:
		print(-1)
	else:
		ans = deque(['3'])
		if (n - 1) % 3 == 0:
			ans.append('3')
			for j in range(n - 2):
				ans.appendleft('2')
		else:
			for i in range(n - 1):
				ans.appendleft('2')
		print(''.join(ans))


def solve():
	n = int(input())
	if n == 1:
		print(-1)
		return
	print(8, end='')
	for i in range(n - 1):
		print(9, end='')
	print(' ')
t = int(input())
for _ in range(t):
	solve()


test = int(input())
for _ in range(test):
	n = int(input())
	if n == 1:
		print('-1')
		continue
	s = '5' * (n - 1) + '4'
	print(s)


test = int(input())
for ij in range(test):
	s = '2'
	n = int(input())
	if n == 1:
		s = '-1'
	else:
		i = 1
		while i < n:
			s += '3'
			i += 1
	print(s)


t = int(input())
cases = [int(input()) for i in range(t)]
for n in cases:
	if n == 1:
		print(-1)
	else:
		num_list = ['5' for i in range(n - 1)]
		num_list.append('4')
		print(''.join(num_list))


queries = int(input())
for _ in range(queries):
	number = int(input())
	if number == 1:
		print('-1')
	else:
		toadd = '3' * (number - 1)
		print('2' + toadd)


for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print(-1)
	else:
		t = '9' * (n - 1)
		if t.count('9') % 6 != 0:
			print(t + '7')
		else:
			print('2' + '3' * (n - 1))


from sys import stdin
try:
	for _ in range(int(stdin.readline())):
		n = int(stdin.readline())
		if n == 1:
			print(-1)
		else:
			s = str(2)
			s += str(3) * (n - 1)
			print(s)
except:
	pass


from math import ceil, sqrt, log

def ii():
	return int(input())

def si():
	return input()

def mi():
	return map(int, input().split())

def li():
	return list(mi())

def main():
	for _ in range(ii()):
		n = ii()
		if n == 1:
			print('-1')
			continue
		if n == 2:
			print('27')
			continue
		if n == 3:
			print('239')
			continue
		n -= 2
		if n % 2 == 0:
			x = n // 2
			s = '42' * x
			s += '37'
			print(s)
		else:
			x = n // 2
			s = '42' * x + '2' + '6' + '7'
			print(s)
main()


T = int(input())
for _ in range(T):
	n = int(input())
	if n == 1:
		print(-1)
		print('\n')
		continue
	lst = [2] * n
	lst[-1] = 3
	su = (n - 1) * 2 + 3
	if su % 3 == 0:
		lst[0] += 2
	for d in lst:
		print(d, end='')
	print('\n')


a = int(input())
for i in range(a):
	b = int(input())
	if b == 1:
		print(-1)
	else:
		print(6 * 10 ** (b - 1) + 7 * (10 ** (b - 1) // 9))


import time
import os, sys
from io import BytesIO, IOBase
from types import GeneratorType
from bisect import bisect_left, bisect_right
from collections import defaultdict as dd, deque as dq, Counter as dc
import math, string, heapq as h
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		import os
		self.os = os
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = self.os.read(self._fd, max(self.os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = self.os.read(self._fd, max(self.os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			self.os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def getInt():
	return int(input())

def getStrs():
	return input().split()

def getInts():
	return list(map(int, input().split()))

def getStr():
	return input()

def listStr():
	return list(input())

def getMat(n):
	return [getInts() for _ in range(n)]

def getBin():
	return list(map(int, list(input())))

def isInt(s):
	return '0' <= s[0] <= '9'

def ceil_(a, b):
	return a // b + (a % b > 0)
MOD = 10 ** 9 + 7

def solve():
	N = getInt()
	if N == 1:
		return -1
	ans = ['4'] + ['3'] * (N - 1)
	return ''.join(ans)
for _ in range(getInt()):
	print(solve())


from sys import stdin
n = int(stdin.readline())
for _ in range(n):
	s = int(stdin.readline())
	if s == 1:
		print(-1)
	else:
		print(2, end='')
		for j in range(s - 1):
			print(3, end='')
		print('')


q = int(input())
for i in range(q):
	sums = 0
	ans = ''
	n = int(input())
	if n == 1:
		print(-1)
		continue
	ans = '2' * (n - 1)
	sums = 2 * (n - 1)
	if sums % 3 == 0:
		ans += '7'
		if int(ans) % 7 == 0:
			ans = '2' * (n - 2)
			ans += '57'
			print(ans)
		else:
			print(ans)
	else:
		print(ans + '3')


T = int(input())
for t in range(T):
	N = int(input())
	if N == 1:
		print(-1)
	else:
		nb1 = int('2' * (N - 1) + '3')
		if nb1 % 3:
			print(nb1)
		else:
			print(int('2' * (N - 2) + '33'))


import sys

def rr():
	return sys.stdin.readline().rstrip()

def rri():
	return int(rr())

def rrl():
	return list(map(int, rr().split()))

def rrt():
	return tuple(map(int, rr().split()))

def rrle():
	return (line.rstrip() for line in sys.stdin.readlines())

def rrtl():
	return [tuple(map(int, l.split())) for l in rrle()]
from collections import defaultdict

def mus(d=lambda : 0):
	return defaultdict(lambda : defaultdict(d))

def dd0(d=lambda : 0):
	return defaultdict(d)

def ms(x, y, d=0):
	return [[0] * y for i in range(x)]

def ar(x, d=0):
	return [d] * x

def ppm(m, n=0, x=0, y=0):
	print('\n'.join(('\t'.join((str(m[j][i]) for j in range(y or n))) for i in range(x or n))))

def ppa(a, n):
	print('\t'.join(map(str, a[0:n])))

def ppl(a=0, x=[1]):
	x[0] = a or x[0] + 1
	print('-' + '- -' * 14 + '-# ' + str(x[0] - 2) + ' #-' + '- -' * 14 + '-')

def fltn(a):
	(i for sub in a for i in sub)

def yn(x):
	return 'YES' if x else 'NO'
from itertools import accumulate
from itertools import groupby
from itertools import permutations

def grp(x, key=None):
	return ((i, sum((1 for _ in g))) for (i, g) in groupby(x, key=key))
import math

def rnar():
	return (*rrl(), rrl())

def rn():
	return (*rrl(),)

def dpp(a, b=''):
	print('#| {} |#:^ {} ^:'.format(a, b))
MOD17 = 10 ** 9 + 7

def read():
	return (rri(),)

def solve(n):
	if n == 1:
		ans = -1
	else:
		ans = '2' + '3' * (n - 1)
	return ans
test_count = rri()
for _ in range(test_count):
	input_data = read()
	result = solve(*input_data)
	print(result)


import sys
input = sys.stdin.readline

def main():
	for _ in range(int(input())):
		n = int(input())
		if n < 2:
			print(-1)
			continue
		ans = '9' * (n - 1) + '8'
		print(ans)
main()


def main():
	t = int(input())
	for _ in range(t):
		n = int(input())
		if n < 2:
			print(-1)
			continue
		ret = ''
		if (2 * (n - 1) + 3) % 3 == 0:
			ret = '2' * (n - 2) + '4' + '3'
		else:
			ret = '2' * (n - 1) + '3'
		print(ret)
main()


from sys import stdin

def solve(n):
	return '2' + '3' * (n - 1) if n > 1 else '-1'
input()
for line in stdin:
	print(solve(int(line)))


t = int(input())
while t != 0:
	t = t - 1
	n = int(input())
	ans = ''
	sum = 0
	if n == 1:
		print(-1)
	else:
		sum = '2'
		for j in range(0, n - 1):
			sum += '3'
		print(sum)


def process(n):
	if n < 2:
		return '-1'
	res = '2'
	res += '3' * (n - 1)
	return res
limit = int(input())
for i in range(limit):
	n = int(input())
	res = process(n)
	print(res)


class Solution:

	def solve(self, n):
		if n == 1:
			return -1
		return '5' * (n - 1) + '4'

def main():
	inp = lambda : [int(x) for x in input().split()]
	tc = int(input())
	sol = Solution()
	for _ in range(tc):
		n = int(input())
		print(sol.solve(n))
main()


def uglynum(n):
	if n == 1:
		return -1
	t = '2' + '3' * (n - 1)
	return int(t)
cases = int(input())
for _ in range(cases):
	x = int(input())
	print(uglynum(x))


import sys
IN = sys.stdin.readline
for i in range(int(IN())):
	a = int(IN())
	print('-1' if a == 1 else '2' + '3' * (a - 1))


t = int(input())
last = ['4', '8', '7', '9']
for i in range(t):
	n = int(input())
	ans = ['3'] * (n - 1)
	for i in last:
		ans2 = ans[:]
		ans2.append(i)
		res = int(''.join(ans2))
		if res % int(i) != 0:
			print(res)
			break
	else:
		print(-1)


import math
n = int(input())
Result = []
for i in range(0, n):
	List = []
	digits = int(input())
	if digits == 1:
		Result.append(-1)
	else:
		for j in range(0, digits):
			if j == 0:
				List.append('2')
			else:
				List.append('3')
		x = ''.join(List)
		Result.append(x)
for i in Result:
	print(i)


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def RL():
	return map(int, sys.stdin.readline().rstrip().split())

def RLL():
	return list(map(int, sys.stdin.readline().rstrip().split()))

def N():
	return int(input())

def print_list(l):
	print(' '.join(map(str, l)))
for _ in range(N()):
	n = N()
	if n == 1:
		print(-1)
	elif n % 6 == 1:
		print('2' * (n - 2) + '37')
	else:
		print('2' * (n - 1) + '7')


for _ in range(int(input())):
	n = int(input())
	z = 0
	if n == 1:
		print(-1)
		continue
	print('5' * (n - 1) + '4')


for i in range(int(input())):
	n = int(input())
	if n == 1:
		print(-1)
	elif (n - 1) % 3 == 0:
		s = ['2'] * (n - 2)
		s.append('33')
		print(''.join(s))
	else:
		s = ['2'] * (n - 1)
		s.append('3')
		print(''.join(s))


for i in range(int(input())):
	n = int(input())
	if n == 1:
		print(-1)
	else:
		num = int('9' * n) - 1
		if num % 9 != 0 and num % 8 != 0:
			print(num)
		else:
			print(num - 1)


t = int(input())
for q in range(t):
	n = int(input())
	if n == 1:
		print(-1)
	else:
		print('3' * (n - 1) + '4')


for _ in range(int(input())):
	n = int(input())
	s = '5' * (n - 1)
	ans = ''
	for i in range(2, 10):
		sm = 0
		for j in range(n - 1):
			sm = sm * 10 + (ord(s[j]) - 48)
			sm %= i
		if (sm * 10 + i) % i != 0:
			ans = s + str(i)
	if n != 1:
		print(ans)
	else:
		print('-1')


def solve():
	n = int(input())
	if n == 1:
		print(-1)
	else:
		print('5' * (n - 1) + '8')
t = int(input())
while t > 0:
	t -= 1
	solve()


tc = int(input())
for tc in range(tc):
	l = int(input())
	if l == 1:
		print(-1)
	else:
		ans = '2' + '3' * (l - 1)
		print(int(ans))


import sys
input = sys.stdin.readline
Q = int(input())
Query = [int(input()) for _ in range(Q)]
for N in Query:
	if N == 1:
		print(-1)
	else:
		ans = '2' + '9' * (N - 1)
		print(ans)


alph = 'abcdefghijklmnopqrstuvwxyz'
t = int(input())
for i in range(t):
	n = int(input())
	if n == 1:
		print(-1)
	elif n % 3 == 1:
		print('2' * (n - 2) + '33')
	else:
		print('4' * (n - 1) + '3')


t = int(input())
arr = []
for i in range(t):
	n = int(input())
	if n == 1:
		s = -1
	elif n % 2 == 0:
		s = '58' * (n // 2)
	else:
		s = '85' * (n // 2) + '8'
	arr.append(int(s))
for j in arr:
	print(j)


def func():
	n = int(input())
	if n == 1:
		print(-1)
		return
	print('2' + '3' * (n - 1))
	return
t = int(input())
for _ in range(t):
	func()


for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print(-1)
	else:
		x = 1
		ans = '2' * n
		ans = int(ans) + 1
		while ans % (ans % 10) == 0:
			ans = ans + 2
		print(ans)


testCase = int(input())
for i in range(testCase):
	n = int(input())
	if n == 1:
		print(-1)
	else:
		print(2, end='')
		for j in range(1, n):
			print(3, end='')
		print()


def kras(n):
	q = int(n - 1)
	s = '2'
	q = q - 1
	while q >= 0:
		s += '3'
		q = q - 1
	if n != 1:
		return s
	return -1
n = int(input())
for i in range(n):
	t = int(input())
	print(kras(t))


import sys
input = lambda : sys.stdin.readline().rstrip()
for i in range(int(input())):
	a = int(input())
	if a == 1:
		print(-1)
	elif 2 * (a - 1) % 3 == 0:
		print('2' * (a - 2) + '7' + '3')
	else:
		print('2' * (a - 1) + '3')


def test(n):
	if n == 1 or n == 0:
		return -1
	resposta = ''
	for j in range(n - 1):
		resposta += '3'
	resposta += '4'
	return resposta
x = int(input())
for i in range(x):
	n = int(input())
	print(test(n))


def in1():
	return int(input())

def in3():
	return map(int, input().split())

def inx():
	return [int(_) for _ in input().split()]
t = in1()
for _ in range(t):
	n = in1()
	if n == 1:
		print(-1)
	else:
		print('3' * (n - 1) + '4')


t = int(input())
for k in range(0, t):
	n = int(input())
	if n == 1:
		print(-1)
	else:
		s = '9' * (n - 1)
		s = s + '8'
		print(int(s))


t = int(input())
for _ in range(t):
	a = int(input())
	if a == 1:
		print('-1')
	else:
		print('2', end='')
		for i in range(a - 1):
			print('3', end='')
		print()


import random
for tc in range(int(input())):
	n = int(input())
	if n < 2:
		print(-1)
		continue
	while True:
		good = True
		b = int(''.join([random.choice('89') for _ in range(n)]))
		for dig in (8, 9):
			if not b % dig:
				good = False
				break
		if good:
			break
		b += 1
	print(b)


t = int(input())
for case in range(t):
	n = int(input())
	if n == 1:
		print(-1)
	else:
		p = ['2']
		q = ['3'] * (n - 1)
		print(''.join(p + q))


import sys
input = sys.stdin.readline
t = int(input())
for _ in range(t):
	n = int(input())
	if n == 1:
		print(-1)
		continue
	s = '2' + '3' * (n - 1)
	print(s)


import heapq as hp
import collections
import bisect
import math
import re

def unpack(func=int):
	return map(func, input().split())

def l_unpack(func=int):
	return list(map(func, input().split()))

def s_unpack(func=int):
	return sorted(map(func, input().split()))

def ml_unpack(n):
	return [int(input()) for i in range(n)]

def range_n():
	return range(int(input()))

def counter(a):
	d = {}
	for x in a:
		if x in d:
			d[x] += 1
		else:
			d[x] = 1
	return d

def getint():
	return int(input())

def have_1_or_0(n):
	while n:
		t = n % 10
		if t == 0 or t == 1:
			return True
		n //= 10
	return False

def main():
	for _ in range_n():
		n = getint()
		if n == 1:
			print(-1)
		else:
			n -= 1
			print('2' + '3' * n)
main()


from sys import stdin, stdout
t = int(stdin.readline())
while t > 0:
	n = int(stdin.readline())
	if n == 1:
		print('-1')
	else:
		print('2' + '3' * (n - 1))
	t = t - 1


import sys
import random
from math import log2, log, ceil
input = sys.stdin.readline

def swaparr(arr, a, b):
	temp = arr[a]
	arr[a] = arr[b]
	arr[b] = temp

def gcd(a, b):
	if a > 0:
		return gcd(b % a, a)
	return b

def primefs(n):
	if n == 1:
		return 1
	primes = {}
	while n % 2 == 0:
		primes[2] = primes.get(2, 0) + 1
		n = n // 2
	for i in range(3, int(n ** 0.5) + 2, 2):
		while n % i == 0:
			primes[i] = primes.get(i, 0) + 1
			n = n // i
	if n > 2:
		primes[n] = primes.get(n, 0) + 1
	return primes

def swap(a, b):
	temp = a
	a = b
	b = temp
	return (a, b)

def find(x, link):
	while x != link[x]:
		x = link[x]
	return x

def union(x, y, size, link):
	x = find(x, link)
	y = find(y, link)
	if size[x] < size[y]:
		(x, y) = swap(x, y)
	if x != y:
		size[x] += size[y]
		link[y] = x

def sieve(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	return prime
MAXN = int(1000000.0 + 5)

def spf_sieve():
	spf[1] = 1
	for i in range(2, MAXN):
		spf[i] = i
	for i in range(4, MAXN, 2):
		spf[i] = 2
	for i in range(3, ceil(MAXN ** 0.5), 2):
		if spf[i] == i:
			for j in range(i * i, MAXN, i):
				if spf[j] == j:
					spf[j] = i
spf = [0 for i in range(MAXN)]
spf_sieve()

def factoriazation(x):
	ret = {}
	while x != 1:
		ret[spf[x]] = ret.get(spf[x], 0) + 1
		x = x // spf[x]
	return ret

def int_array():
	return list(map(int, input().split()))
for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print(-1)
	else:
		print('2' + '3' * (n - 1))


from math import ceil, sqrt, floor
import sys
n = int(input())
for i in range(n):
	a = int(input())
	if a == 1:
		print(-1)
	else:
		print('2' + '3' * (a - 1))


for __ in range(int(input())):
	n = int(input())
	l = []
	if n == 1:
		print(-1)
	else:
		if (n - 1) % 3 != 0:
			for i in range(n - 1):
				l.append(2)
			l.append(3)
		else:
			for i in range(n - 2):
				l.append(2)
			l.append(4)
			l.append(3)
		s = ''
		for i in range(n):
			l[i] = str(l[i])
		s = s.join(l)
		s = int(s)
		print(s)


import sys
n = int(input())
for i in range(n):
	x = int(input())
	if x == 1:
		print(-1)
	else:
		for j in range(x - 2):
			sys.stdout.write('3')
		sys.stdout.write('73')
	sys.stdout.write('\n')


for i in range(int(input())):
	n = int(input())
	if n == 1:
		print(-1)
	else:
		x = '2' * (n - 1) + '7'
		if int(x) % 7 == 0:
			x = '2' * (n - 2) + '7' * 2
		print(x)


user = input()
data = []
for i in range(0, int(user)):
	num = input()
	data.append(int(num))
baseNumber = 63
for i in range(0, len(data)):
	if data[i] == 1:
		print('-1')
	elif data[i] == 2:
		print('43')
	else:
		rem = data[i] - 2
		if (rem * 2 + 6 + 3) % 3 != 0:
			finalString = rem * '2'
			finalString = finalString + '6' + '3'
		else:
			finalString = (rem - 1) * '2'
			finalString = '3' + finalString + '6' + '3'
		print(finalString)


for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print(-1)
		continue
	s = (n - 1) * '2' + '3'
	if (n - 1) % 3 == 0:
		s = '4' + s[1:]
	print(s)


t = int(input())
while t > 0:
	t -= 1
	s = int(input())
	if s == 1:
		print(-1)
	elif s == 2:
		print(57)
	else:
		print('8' + ''.join(['5' for i in range(s - 2)]) + '7')


t = int(input())
for i in range(t):
	n = int(input())
	if n == 1:
		print(-1)
	else:
		s = '59'
		cd = 5
		for i in range(n - 2):
			if (cd + 5) % 9 == 0:
				cd += 2
				print('2', end='')
			else:
				cd += 5
				print('5', end='')
		print('59')


t = int(input())
for case in range(t):
	n = int(input())
	if n == 1:
		print(-1)
	elif n % 3 == 1:
		ans = ''
		for i in range(n - 2):
			ans += '2'
		ans += '33'
		print(ans)
	else:
		ans = ''
		for i in range(n - 1):
			ans += '2'
		ans += '3'
		print(ans)


def main():
	n = int(input())
	sm = 0
	line = ''
	if n == 1:
		print(-1)
		return
	if (n - 1) % 3 == 0:
		for i in range(n - 2):
			line += '2'
		line += '33'
		print(line)
		return
	else:
		for i in range(n - 1):
			line += '2'
		line += '3'
		print(line)
		return
t = int(input())
for i in range(t):
	main()


def solution(n):
	if n == 1:
		print(-1)
		return
	ans = [2] * (n - 1) + [9]
	if (n - 1) % 9 == 0:
		ans[0] = 4
	print(''.join(map(str, ans)))
t = int(input())
for _ in range(t):
	solution(int(input()))


for test_case in range(int(input())):
	n = int(input())
	if n == 1:
		print(-1)
	else:
		sum = 2 * (n - 1) + 3
		if sum % 3 != 0:
			print('2' * (n - 1) + '3')
		else:
			print('2' * (n - 2) + '33')


from collections import Counter
from collections import defaultdict
import math
t = int(input())
for _ in range(0, t):
	n = int(input())
	if n == 1:
		print(-1)
	else:
		a = str(2) + '3' * (n - 1)
		s = ''.join(a)
		print(s)


for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print('-1')
	else:
		num = int(n * '2')
		if (n - 1) % 3 == 0:
			print(num + 11)
		else:
			print(num + 1)


import math

def sol():
	t = int(input())
	for _ in range(t):
		n = int(input())
		s = '2'
		if n == 1:
			print(-1)
			continue
		else:
			for i in range(n - 1):
				s += '3'
		print(s)
sol()


for i in range(int(input())):
	n = int(input())
	if n < 2:
		print(-1)
	else:
		if (n - 1) % 3 == 0:
			print(4, end='')
		else:
			print(2, end='')
		print('2' * (n - 2) + '3')


def process():
	n = int(input())
	if n == 1:
		print('-1')
		return
	if n == 2:
		print('23')
		return
	else:
		c = '2'
		print(c, end='')
		for i in range(1, n):
			print('3', end='')
		print()
tests = int(input())
for i in range(0, tests):
	process()


t = int(input())
i = 0
while i < t:
	i += 1
	n = int(input())
	if n == 1:
		print('-1')
		continue
	if (n - 1) % 3 == 0:
		ans = '5' * (n - 2) + '43'
	else:
		ans = '5' * (n - 1) + '3'
	print(ans)


t = int(input())
for i in range(t):
	n = int(input())
	if n == 1:
		print(-1)
	else:
		print(''.join(map(str, [5] + [9] * (n - 1))))


x = int(input())
for i in range(x):
	y = int(input())
	if y == 1:
		print('-1')
	else:
		print('2', end='')
		for z in range(y - 1):
			print('3', end='')
		print()


import sys
I = sys.stdin.readline
ans = ''
for _ in range(int(I())):
	n = int(I())
	if n == 1:
		ans += '-1\n'
	else:
		s = '78'
		s += s[:1] * n
		ans += '{}\n'.format(s[:n])
print(ans)


n = int(input())
for n in range(n):
	x = int(input())
	if x < 2:
		print(-1)
		continue
	arr = '2'
	x -= 1
	for i in range(x):
		arr += '3'
	print(arr)


t = int(input())
while t > 0:
	inp = int(input())
	num = '2'
	if inp == 1:
		print(-1)
	else:
		num = num + (inp - 1) * '3'
		print(int(num))
	t -= 1


val_a = input()
t = int(val_a)
for i in range(0, t, 1):
	val_b = input()
	n = int(val_b)
	if n != 1:
		v = '3' * (n - 1)
		s = '2' + v
		print(s)
	else:
		print('-1')


from sys import stdin
input = stdin.readline

def main():
	test = int(input())
	for _ in range(test):
		n = int(input())
		if n == 1:
			print(-1)
		else:
			s = '2' + (n - 1) * '3'
			print(s)
main()


for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print(-1)
	else:
		n -= 1
		i = 0
		x = n // 2
		if (3 + 2 * x + 5 * (n - x)) % 3 != 0:
			print('2' * x + '5' * (n - x) + '3')
		else:
			print('3' + '2' * (x - 1) + '5' * (n - x) + '3')


n = int(input())
for _ in range(n):
	x = int(input())
	if x == 1:
		print(-1)
		continue
	a = '2' + '9' * (x - 1)
	print(a)


def slove(a):
	res = '2'
	if a - 1 == 0:
		return -1
	if (a - 1) % 3 == 0:
		return res * (a - 2) + '3' * 2
	else:
		return res * (a - 1) + '3'
n = int(input())
for i in range(0, n):
	a = int(input())
	print(slove(a))


from sys import stdin
from bisect import bisect_left as bl
from bisect import bisect_right as br

def input():
	return stdin.readline()[:-1]

def intput():
	return int(input())

def sinput():
	return input().split()

def intsput():
	return map(int, sinput())

class RangedList:

	def __init__(self, start, stop, val=0):
		self.shift = 0 - start
		self.start = start
		self.stop = stop
		self.list = [val] * (stop - start)

	def __setitem__(self, key, value):
		self.list[key + self.shift] = value

	def __getitem__(self, key):
		return self.list[key + self.shift]

	def __repr__(self):
		return str(self.list)

	def __iter__(self):
		return iter(self.list)

def dprint(*args, **kwargs):
	if debugging:
		print(*args, **kwargs)
debugging = 1
t = intput()
for _ in range(t):
	n = intput()
	if n == 1:
		print(-1)
	else:
		print('7' * (n - 1) + '8')


from sys import stdin
inf = stdin
for qw in range(int(inf.readline())):
	n = int(inf.readline())
	if n == 1:
		print(-1)
	else:
		print('3' * (n - 1) + '4')


import math
import sys
input = sys.stdin.readline
t = int(input())
for i in range(t):
	n = int(input())
	s = []
	for i in range(n - 1):
		s.append('9')
	s.append('4')
	if n == 1:
		print(-1)
	else:
		print(''.join(s))


import os, sys
if os.path.exists('inp.txt'):
	sys.stdin = open('inp.txt', 'r')

def _():
	return sys.stdin.readline()

def __():
	return sys.stdin.readline().split()
maxn = 100005
t = int(_())
for id in range(t):
	n = int(_())
	if n == 1:
		print(-1)
		continue
	for i in range(1, n - 1):
		print(2, end='')
	print(53 if not 2 * (n - 2) % 3 else 33)


t = int(input())
while t > 0:
	n = int(input())
	s = ''
	if n == 1:
		s = '-1'
	else:
		s = '3' * (n - 2)
		s += '23'
	print(s)
	t -= 1


import sys
import os
import time
import collections
from collections import Counter, deque
import itertools
import math
import timeit
import random
from io import BytesIO, IOBase
from bisect import bisect_left as bl
from bisect import bisect_right as br

def sieve(n):
	if n < 2:
		return list()
	prime = [True for _ in range(n + 1)]
	p = 3
	while p * p <= n:
		if prime[p]:
			for i in range(p * 2, n + 1, p):
				prime[i] = False
		p += 2
	r = [2]
	for p in range(3, n + 1, 2):
		if prime[p]:
			r.append(p)
	return r

def divs(n, start=1):
	divisors = []
	for i in range(start, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n / i == i:
				divisors.append(i)
			else:
				divisors.extend([i, n // i])
	return divisors

def divn(n, primes):
	divs_number = 1
	for i in primes:
		if n == 1:
			return divs_number
		t = 1
		while n % i == 0:
			t += 1
			n //= i
		divs_number *= t

def flin(d, x, default=-1):
	left = right = -1
	for i in range(len(d)):
		if d[i] == x:
			if left == -1:
				left = i
			right = i
	if left == -1:
		return (default, default)
	else:
		return (left, right)

def modpow(b, p, m):
	res = 1
	b = b % m
	while p:
		if p & 1:
			res = res * b % m
		b = b * b % m
		p >>= 1
	return res

def mod_inv(a, m):
	return modpow(a, m - 2, m)

def ncr(n, r, m):
	res = 1
	if r == 0:
		return 1
	if n - r < r:
		r = n - r
	(p, k) = (1, 1)
	while r:
		res = res % m * (n % m * mod_inv(r, m) % m) % m
		n -= 1
		r -= 1
	return res

def ncrlis(n, r, m, fact):
	return fact[n] * (mod_inv(fact[r], m) * mod_inv(fact[n - r], m)) % m % m

def dfs(u, lis):
	vis[u] = True
	lis.append(u)
	for v in g[u]:
		if not vis[v]:
			lis = dfs(v, lis)
	return lis

def dfsutil():
	cnc = []
	for i in range(1, n + 1):
		if not vis[i]:
			tmp = []
			cnc.append(dfs(i, tmp))
	return cnc

def bfs(s, prev):
	q = deque()
	q.append(s)
	vis[s] = True
	while q:
		u = q.popleft()
		for v in g[u]:
			if not vis[v]:
				q.append(v)
				vis[v] = True
				prev[v] = u

def path(s, e):
	prev = [False for i in range(n + 1)]
	bfs(s, prev)
	at = e
	res = []
	while at != False:
		res.append(at)
		at = prev[at]
	res.reverse()
	if res[0] == s:
		return res
	else:
		return []

def ceil(n, k):
	return n // k + (n % k != 0)

def ii():
	return int(input())

def mi():
	return map(int, input().split())

def li():
	return list(map(int, input().split()))

def lcm(a, b):
	return abs(a * b) // math.gcd(a, b)

def prr(a, sep=' '):
	print(sep.join(map(str, a)))

def dd():
	return collections.defaultdict(int)

def ddl():
	return collections.defaultdict(list)

def ddd():
	return collections.defaultdict(collections.defaultdict(int))
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
for _ in range(ii()):
	n = ii()
	if n == 1:
		print(-1)
	else:
		print('5' + '3' * (n - 1))


from sys import stdin

def main():
	t = int(stdin.readline())
	for _ in range(t):
		n = int(stdin.readline())
		if n == 1:
			print(-1)
			continue
		ans = ''
		if (n - 1) % 3 != 0:
			for _ in range(n - 1):
				ans += '2'
			ans += '3'
			ans = int(ans)
		else:
			if (n - 1) % 6 == 0:
				for _ in range(n - 2):
					ans += '2'
				ans += '77'
			else:
				for _ in range(n - 1):
					ans += '2'
				ans += '7'
			ans = int(ans)
		print(ans)
main()


t = int(input())
for _ in range(t):
	n = int(input())
	if n == 1:
		print(-1)
		continue
	a = []
	a.append('2')
	for i in range(n - 1):
		a.append('3')
	print(''.join(a))


t = int(input())
for i in range(t):
	s = int(input())
	if s == 1:
		print(-1)
	else:
		print('2' + '7' * (s - 1))


t = int(input())
while t:
	n = int(input())
	if n == 1:
		print(-1)
	else:
		print('4' + '3' * (n - 1))
	t -= 1


from io import BytesIO
import os
for _ in range(int(input())):
	a = int(input())
	if a == 1:
		print(-1)
	else:
		print('5' * (a - 1) + '4')


t = int(input())
while t > 0:
	result = ''
	n = int(input())
	if n == 1:
		print(-1)
	else:
		result += '2'
		for i in range(n - 1):
			result += '3'
		print(result)
	t -= 1


t = int(input())
fin = ''
for e in range(t):
	n = int(input())
	if n == 1:
		fin += '-1\n'
		continue
	s = int('2' + '7' * (n - 1))
	if s % 7:
		fin += str(s) + '\n'
	else:
		fin += '4' + '7' * (n - 1) + '\n'
print(fin)


from math import *
from cmath import *
t = int(input())
for _ in range(t):
	n = int(input())
	if n == 1:
		print('-1')
	else:
		print('5', end='')
		for i in range(n - 1):
			print('9', end='')
		print()


def linput(a):
	return [int(i) for i in a.split()]
q = int(input())
for ughblnk in range(q):
	n = int(input())
	if n == 1:
		print(-1)
	else:
		print('2' + '3' * (n - 1))


from bisect import bisect_left as bl, bisect_right as br, insort
import sys
import heapq
from collections import defaultdict as dd, deque

def data():
	return sys.stdin.readline().strip()

def mdata():
	return map(int, data().split())
mod = int(1000000000.0 + 7)
for i in range(int(data())):
	n = int(data())
	if n == 1:
		print(-1)
	else:
		s = str(9) * (n - 1) + str(8)
		print(s)


t = int(input())
for _ in range(t):
	n = int(input())
	if n == 1:
		print('-1')
	else:
		s = '2' * (n - 2)
		if n >= 4 and (n - 1) % 3 == 0:
			s += '33'
		else:
			s += '23'
		print(s)


def getUglyNumber(v):
	if v == 1:
		print(-1)
	else:
		print(2, end='')
		j = 1
		while j < v - 1:
			print(3, end='')
			j = j + 1
		print(3)
t = int(input())
for i in range(t):
	v = int(input())
	getUglyNumber(v)


t = int(input())
for _ in range(t):
	n = int(input())
	if n == 1:
		print(-1)
	elif n % 2 == 0:
		if 5 * (n // 2) % 3 != 0:
			print('23' * (n // 2))
		else:
			s = '23' * (n // 2 - 1) + '69'
			print(s)
	elif 5 * (n // 2) % 3 != 0:
		print('23' * (n // 2) + '9')
	else:
		print('23' * (n // 2 - 1) + '999')


def gcd(a, b):
	if a == 0:
		return b
	return gcd(b % a, a)

def lcm(a, b):
	return a * b / gcd(a, b)
test = int(input())
while test > 0:
	x = int(input())
	test = test - 1
	if x == 1:
		print('-1')
	else:
		ans = '2'
		while x > 1:
			ans = ans + '3'
			x = x - 1
		print(ans)


import sys
input = sys.stdin.readline
t = int(input())
for tests in range(t):
	n = int(input())
	if n == 1:
		print(-1)
	elif (8 * (n - 1) + 9) % 3 != 0:
		sys.stdout.write('8' * (n - 1) + '9' + '\n')
	else:
		sys.stdout.write('8' * (n - 2) + '49' + '\n')


for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print(-1)
		continue
	flag = 0
	x = '2' * (n - 1)
	y = '3' * (n - 1)
	x1 = x + '3'
	x2 = x + '7'
	x3 = x + '9'
	x4 = y + '4'
	if int(x1) % 3 != 0:
		print(x1)
	elif int(x2) % 7 != 0:
		print(x2)
	elif int(x3) % 9 != 0:
		print(x3)
	elif int(x4) % 4 != 0 and int(x4) % 3 != 0:
		print(x4)
	else:
		print(-1)


for _ in range(int(input())):
	n = int(input())
	s = '-1'
	if n != 1:
		if n % 3 == 0 or n % 3 == 2:
			s = '5' * (n - 1) + '3'
		else:
			s = '3' + '5' * (n - 2) + '3'
	print(s)


from sys import stdin, stderr

def rl():
	return [int(w) for w in stdin.readline().split()]
(t,) = rl()
for _ in range(t):
	(n,) = rl()
	if n > 1:
		print('2' + '3' * (n - 1))
	else:
		print('-1')


import math

def inp_n():
	return int(input())

def inp_list():
	return list(map(int, input().split()))

def inp_mul_num():
	return map(int, input().split())

def is_odd(n):
	if n & 1:
		return True
	return False

def SieveOfEratosthenes(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	return prime
for _ in range(inp_n()):
	n = inp_n()
	f = 0
	v = ''
	if n > 1:
		v = '2' + '3' * (n - 1)
		print(v)
	else:
		print(-1)


for tt in range(int(input())):
	n = int(input())
	if n == 1:
		print(-1)
	else:
		print('8' + '3' * (n - 1))


from sys import stdin, stdout
import math
import random

def main():
	t = int(input())
	for i in range(t):
		n = int(input())
		ans = ''
		if n == 1:
			print(-1)
			continue
		ans += '2'
		for j in range(n - 1):
			ans += '3'
		print(ans)
main()


for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print(-1)
	elif n == 2:
		print(57)
	else:
		str1 = '57'
		temp = '7' * (n - 2)
		print(str1 + temp)


def main():
	t = int(input())
	while t:
		n = int(input())
		if n == 1:
			print(-1)
		else:
			s = '2'
			s += (n - 1) * '3'
			print(s)
		t -= 1
main()


def main():
	n = int(input())
	if n == 1:
		return -1
	else:
		return '2' + (n - 1) * '3'
for _ in range(int(input())):
	print(main())


for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print(-1)
	elif n % 2 == 0:
		print('54' * (n // 2))
	else:
		print('4' + '54' * (n // 2))


import io, os
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
t = int(input())
for _ in range(t):
	n = int(input())
	if n == 1:
		print(-1)
	else:
		st = '2'
		st += '3' * (n - 1)
		print(st)


from __future__ import division, print_function
import os, sys
from io import BytesIO, IOBase
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip
from bisect import bisect_left as lower_bound, bisect_right as upper_bound

def so():
	return int(input())

def st():
	return input()

def mj():
	return map(int, input().strip().split(' '))

def msj():
	return map(str, input().strip().split(' '))

def le():
	return list(map(int, input().split()))

def lebe():
	return list(map(int, input()))

def dmain():
	sys.setrecursionlimit(1000000)
	threading.stack_size(1024000)
	thread = threading.Thread(target=main)
	thread.start()

def joro(L):
	return ''.join(map(str, L))

def decimalToBinary(n):
	return bin(n).replace('0b', '')

def isprime(n):
	for i in range(2, int(n ** 0.5) + 1):
		if n % i == 0:
			return False
	return True

def npr(n, r):
	return factorial(n) // factorial(n - r) if n >= r else 0

def ncr(n, r):
	return factorial(n) // (factorial(r) * factorial(n - r)) if n >= r else 0

def lower_bound(li, num):
	answer = -1
	start = 0
	end = len(li) - 1
	while start <= end:
		middle = (end + start) // 2
		if li[middle] >= num:
			answer = middle
			end = middle - 1
		else:
			start = middle + 1
	return answer

def upper_bound(li, num):
	answer = -1
	start = 0
	end = len(li) - 1
	while start <= end:
		middle = (end + start) // 2
		if li[middle] <= num:
			answer = middle
			start = middle + 1
		else:
			end = middle - 1
	return answer

def abs(x):
	return x if x >= 0 else -x

def binary_search(li, val, lb, ub):
	ans = -1
	while lb <= ub:
		mid = (lb + ub) // 2
		if li[mid] > val:
			ub = mid - 1
		elif val > li[mid]:
			lb = mid + 1
		else:
			ans = mid
			break
	return ans

def kadane(x):
	sum_so_far = 0
	current_sum = 0
	for i in x:
		current_sum += i
		if current_sum < 0:
			current_sum = 0
		else:
			sum_so_far = max(sum_so_far, current_sum)
	return sum_so_far

def pref(li):
	pref_sum = [0]
	for i in li:
		pref_sum.append(pref_sum[-1] + i)
	return pref_sum

def SieveOfEratosthenes(n):
	prime = [True for i in range(n + 1)]
	p = 2
	li = []
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	for p in range(2, len(prime)):
		if prime[p]:
			li.append(p)
	return li

def primefactors(n):
	factors = []
	while n % 2 == 0:
		factors.append(2)
		n //= 2
	for i in range(3, int(sqrt(n)) + 1, 2):
		while n % i == 0:
			factors.append(i)
			n //= i
	if n > 2:
		factors.append(n)
	return factors

def read():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')

def tr(n):
	return n * (n + 1) // 2

def ma(m):
	import math as my
	y = my.floor(my.log(m, 2))
	if y % 2 != 0:
		return y
	return y - 1

def iu():
	import sys
	import math as my
	m = so()
	if m != 1:
		print('2' + '3' * (m - 1))
	else:
		print(-1)

def main():
	for i in range(so()):
		iu()
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print(-1)
	else:
		d = (n - 1) * 2
		g = ''
		if d % 3 != 0:
			for i in range(n - 1):
				g += '2'
			g += '3'
			print(g)
		else:
			t = (n - 2) * 2
			for i in range(n - 2):
				g += '2'
			g += '33'
			print(g)


from sys import stdin, stdout

def main():
	t = int(stdin.readline())
	for _ in range(t):
		n = int(stdin.readline())
		if n == 1:
			stdout.write('-1\n')
			continue
		if (n - 1) % 3 == 0:
			ans = '3' + '2' * (n - 2) + '3'
		else:
			ans = '2' * (n - 1) + '3'
		stdout.write(ans + '\n')
main()


def solve(n):
	if n == 1:
		return '-1'
	elif n == 2:
		return '23'
	elif n % 3 == 0:
		answer = (n - 1) * '2' + '3'
		return answer
	else:
		answer = (n - 3) * '2' + '333'
		return answer
t = int(input())
for case in range(t):
	n = int(input())
	print(solve(n))


t = int(input())
for _ in range(t):
	n = int(input())
	if n == 1:
		print(-1)
	else:
		c_3 = (n + 1) % 3 + 1
		c_2 = n - c_3
		print('2' * c_2 + '3' * c_3)


for _ in range(int(input())):
	i = int(input())
	if i == 1:
		print('-1')
		continue
	w = ''
	for j in range(i):
		if j == 0:
			w = '2'
		else:
			w += '3'
	print(w)


import sys
queries = int(sys.stdin.readline())
for query in range(queries):
	n = int(sys.stdin.readline())
	if n == 1:
		print(-1)
	else:
		print('3' * (n - 2) + '23')


from sys import stdin
input = lambda : stdin.readline()
ii = lambda : int(input())
mi = lambda : map(int, input().split())
li = lambda : list(map(int, input().split()))
for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print(-1)
	else:
		print('7' * (n - 1) + '8')


def get_ans(n):
	if n == 1:
		return -1
	else:
		l = '2' + '3' * (n - 1)
		return int(l)
t = int(input())
while t:
	n = int(input())
	p = get_ans(n)
	print(p)
	t -= 1


a = input()
i = int(a)
x = 0
lst = []
c = 1
while x < i:
	x += 1
	b = input()
	n = int(b)
	if n == 1:
		print(-1)
	if n != 1:
		print(str(2) + int(n - 1) * str(3))


import random as r
t = int(input())

def genRandom(n):
	if n == 1:
		return -1
	num = int('2' + '7' * (n - 1))
	i = 1
	while num % 7 == 0:
		i += 1
		num = int('2' * i + '7' * (n - i))
	return num
for i in range(t):
	n = int(input())
	print(genRandom(n))


def solve(n):
	if n == 1:
		return -1
	return '2' + '3' * (n - 1)
cases = int(input())
for case in range(cases):
	print(solve(int(input())))


import sys
n = int(sys.stdin.readline())

def bad_ugly_number(t):
	if t == 1:
		return -1
	if (t - 1) % 3 != 0:
		return int('5' * (t - 1) + '3')
	else:
		return int('5' * (t - 1) + '4')
for _ in range(n):
	t = int(sys.stdin.readline())
	print(bad_ugly_number(t))


def solve(n):
	if n == 1:
		print('-1')
		return
	else:
		print('2', end='')
		for i in range(n - 1):
			print('3', end='')
		print('')
		return
t = int(input())
while t:
	n = int(input())
	solve(n)
	t -= 1


t = int(input())
ns = (int(input()) for i in range(t))
for n in ns:
	if n == 1:
		print(-1)
	else:
		print(''.join(('3' for i in range(n - 2))) + '23')


tc = int(input().strip())
for t in range(tc):
	n = int(input().strip())
	if n == 1:
		print(-1)
	else:
		print('2', end='')
		for i in range(1, n):
			print('3', end='')
		print()


for hm in range(int(input())):
	n = int(input())
	print(-1 if n == 1 else '5' * (n - 1) + '4')


n1 = int(input())
for x in range(n1):
	n2 = int(input())
	if n2 == 1:
		print(-1)
	else:
		print('5' * (n2 - 1) + '4')


a = int(input())
for _ in range(a):
	z = int(input())
	if z <= 1:
		print('-1')
	elif z % 2 == 0:
		for i in range(int(z / 2)):
			print('54', end='')
		print()
	else:
		for i in range(int((z - 1) / 2)):
			print('45', end='')
		print('4')


import math
t = int(input())
for _ in range(t):
	n = int(input())
	arr = []
	arr.append('6')
	if n == 1:
		print('-1')
	else:
		for i in range(1, n):
			arr.append('7')
		print(''.join(arr))


import heapq

def one():
	return int(input())

def more():
	return map(int, input().split())

def isPr(n):
	for i in range(2, int(n ** 0.5)):
		if n % i == 0:
			return False
	return True
for _ in range(one()):
	n = one()
	if n == 1:
		print(-1)
		continue
	print('8' + '9' * (n - 1))


for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print(-1)
		continue
	t = '9' * (n - 1)
	t = '8' + t
	print(t)


t = int(input())
for y in range(t):
	n = int(input())
	if n == 1:
		print(-1)
		continue
	s = []
	for i in range(n - 1):
		s.append('2')
	s.append('3')
	if (n - 1) % 3 == 0:
		s[0] = '3'
	print(''.join(s))


t = int(input())
for rep in range(t):
	n = int(input())
	if n > 1:
		print(10 ** n - 2)
	else:
		print(-1)


t = int(input())
for _ in range(t):
	n = int(input())
	ans = 0
	if n == 1:
		print(-1)
	elif (n - 1) % 6 == 0:
		print('5' * (n - 2) + '7' * 2)
	else:
		print('5' * (n - 1) + '7')


t = input()
for i in range(int(t)):
	n = int(input())
	if n == 1:
		print('-1')
	else:
		st = '2' * (n - 2)
		if (n - 1) % 3 == 0:
			st += '43'
		else:
			st += '23'
		print(st)


import sys, math
q = int(sys.stdin.readline())
for _ in range(q):
	n = int(sys.stdin.readline())
	if n == 1:
		print(-1)
	else:
		for i in range(n - 1):
			print('9', end='')
		print(4)


for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print(-1)
		continue
	print('3' * (n - 2) + '23')


for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print(-1)
		continue
	a = [3] * n
	a[0] = 2
	for i in range(n):
		print(a[i], end='')
	print()


test = '239'
t = int(input())
for k in range(t):
	xstr = input()
	x = int(xstr)
	if x == 1:
		print('-1')
	elif x <= 3:
		print(test[:x])
	else:
		size = x - 3
		test = test + '39' * size
		print(test[:x])


import functools

def cmp(str1, str2):
	if str1 < str2:
		return 1
	elif str1 > str2:
		return -1
	else:
		return 0
import math
t = int(input())
while t:
	t -= 1
	x = int(input())
	if x == 1:
		print(-1)
		continue
	else:
		print(2, end='')
		for i in range(x - 1):
			print(3, end='')
		print()


t = int(input())
for i in range(t):
	n = int(input())
	if n == 1:
		print(-1)
		continue
	if (n - 1) * 5 % 9 == 0:
		print('5' * (n - 1) + '4')
	else:
		print('5' * (n - 1) + '9')


t = int(input())
a = []
while t:
	n = int(input())
	if n == 1:
		a.append('-1')
	else:
		s = ['2']
		s.extend('3' * (n - 1))
		a.append(''.join(s))
	t -= 1
print('\n'.join(a))


t = int(input())
while t > 0:
	s = ''
	count = 0
	a = int(input())
	if a == 1:
		print(-1)
	else:
		for i in range(1, a, 1):
			s += str(5)
		print(s + str(4))
	t -= 1


for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print(-1)
		continue
	ans = ''
	if (n - 1) % 3 == 0:
		for i in range(n - 2):
			ans = ans + '2'
		ans = ans + '6'
		ans = ans + '3'
		print(ans)
	else:
		for i in range(n - 1):
			ans = ans + '2'
		ans = ans + '3'
		print(ans)


for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print(-1)
	else:
		s = '5'
		x = '7'
		x *= n - 1
		print(s + x)


t = int(input())
for _ in range(t):
	n = int(input())
	ans = -1
	if n > 1:
		b = 10 ** (n - 1)
		bb = b - 1
		for i in range(1, 10):
			m = i * b + bb
			if m % 9 != 0 and m % i != 0:
				ans = m
				break
	print(ans)


t = int(input())
for j in range(t):
	a = int(input())
	if a == 1:
		print(-1)
	else:
		print('2' + '3' * (a - 1))


import sys, collections
tc = int(sys.stdin.readline())
for _ in range(tc):
	n = int(sys.stdin.readline())
	if n == 1:
		print(-1)
	else:
		ans = ['3'] * n
		ans[0] = '5'
		print(''.join(ans))


check = [1, 2, 3, 4, 5, 6, 7, 8, 9]
for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print(-1)
		continue
	ans = int('9' * (n - 1))
	for i in check:
		if ans * 10 % i != 0:
			ans = ans * 10 + i
			break
	print(ans)


t = int(input())
for _ in range(t):
	digits = int(input())
	if digits == 1:
		print(-1)
		continue
	else:
		print('2' + '3' * (digits - 1))


def main():
	t = int(input())
	all_input = []
	for i in range(t):
		n = int(input())
		if n == 1:
			print(-1)
		else:
			string_ans = '2'
			for j in range(1, n):
				string_ans += '3'
			print(string_ans)
main()


t = int(input())
while t > 0:
	n = int(input(''))
	if n <= 1:
		print(-1)
	else:
		k = n - 1
		s1 = '2' * 1
		s2 = '3' * k
		s = s1 + s2
		print(s)
	t = t - 1


t = int(input())
for _ in range(t):
	n = int(input())
	if n == 1:
		print(-1)
		continue
	if n % 3 != 0:
		print(4, end='')
	else:
		print(2, end='')
	for i in range(1, n - 1):
		print(2, end='')
	print(3)


T = int(input())
for case in range(T):
	n = int(input())
	if n == 1:
		print(-1)
	else:
		print(str(5) + '3' * (n - 1))


import sys
import math

def ii():
	return sys.stdin.readline().strip()

def idata():
	return [int(x) for x in ii().split()]

def binary_search(array, x):
	(left, right) = (-1, len(array))
	while left + 1 != right:
		middle = (left + right) // 2
		if array[middle] >= x:
			right = middle
		elif array[middle] < x:
			left = middle
	return right

def solve_of_problem():
	n = int(input())
	if n == 1:
		print(-1)
	else:
		print('7' * (n - 2) + '2' + '7')
	return
for ______ in range(int(ii())):
	solve_of_problem()


import sys
from math import *
from collections import defaultdict
from queue import deque
from heapq import heappush, heappop
lines = [line.strip() for line in sys.stdin.readlines()]
t = int(lines[0])
for tt in range(1, 1 + t):
	n = int(lines[tt])
	if n == 1:
		print(-1)
	else:
		print('2' + '3' * (n - 1))


from sys import stdin

def inp():
	return stdin.buffer.readline().rstrip().decode('utf8')

def itg():
	return int(stdin.buffer.readline())

def mpint():
	return map(int, stdin.buffer.readline().split())

def main():
	n = itg()
	if n == 1:
		return -1
	ans = [2] * (n - 1)
	idx = -1
	sm = 2 * (n - 1)
	while True:
		if (sm + 9) % 9 != 0:
			ans.append(9)
			return ''.join(map(str, ans))
		ans[idx] = 9
		sm += 7
		idx -= 1
for case in range(itg()):
	print(main())


from collections import defaultdict
import math
from functools import reduce
for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print(-1)
	else:
		print('2' + '3' * (n - 1))


testcases = int(input())
while testcases > 0:
	testcases = testcases - 1
	n = int(input())
	if n == 1:
		print('-1')
		continue
	else:
		string = '2' + '3' * (n - 1)
		print(string)


from math import *

def binarySearch(arr, x, i):
	l = i
	r = len(arr) - 1
	while l <= r:
		mid = (l + r) // 2
		if arr[mid] == x:
			return mid
		elif arr[mid] < x:
			l = mid + 1
		else:
			r = mid - 1
	return -1

def js(arr, x):
	l = 0
	r = len(arr) - 1
	ans = -1
	while l <= r:
		m = (l + r) // 2
		if arr[m] <= x:
			ans = m
			l = m + 1
		else:
			r = m - 1
	return ans

def jg(arr, x, i):
	l = i
	r = len(arr) - 1
	ans = -1
	while l <= r:
		m = (l + r) // 2
		if arr[m] >= x:
			ans = m
			r = m - 1
		else:
			l = m + 1
	return ans
d = [2, 3, 5, 7]
for __ in range(int(input())):
	n = int(input())
	if n == 1:
		print(-1)
	else:
		print('2' + '7' * (n - 1))


t = int(input())
for _ in range(t):
	n = int(input())
	if n == 1:
		print(-1)
	else:
		arr = []
		for i in range(n - 1):
			arr.append(2)
		arr.append(3)
		if (n - 1) % 3 == 0:
			arr[0] = 4
		for term in arr:
			print(term, end='')
		print(' ')


import io, os
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline

def get_str():
	return input().decode().strip()

def rint():
	return map(int, input().split())

def oint():
	return int(input())
t = oint()
for _ in range(t):
	ans = []
	n = oint()
	if n == 1:
		print(-1)
		continue
	if n % 3 == 0:
		for i in range(n - 1):
			ans.append(2)
		ans.append(3)
	elif n % 3 == 1:
		for i in range(n - 2):
			ans.append(2)
		ans.append(3)
		ans.append(3)
		pass
	elif n % 3 == 2:
		for i in range(n - 1):
			ans.append(2)
		ans.append(3)
	print(''.join(map(str, ans)))


a = int(input())
for _ in range(a):
	x = int(input())
	if x == 1:
		print(-1)
		continue
	b = '2' + '7' * (x - 1)
	print(int(b))


R = lambda : map(int, input().split())
t = int(input())
for _ in range(t):
	n = int(input())
	if n == 1:
		print(-1)
		continue
	if n % 3 == 0 or n % 3 == 2:
		print('2' * (n - 1) + '3')
	if n % 3 == 1:
		print('2' * (n - 2) + '4' + '3')


from sys import stdin
from collections import deque
from math import sqrt, floor, ceil, log, log2, log10, pi, gcd, sin, cos, asin

def ii():
	return int(stdin.readline())

def fi():
	return float(stdin.readline())

def mi():
	return map(int, stdin.readline().split())

def fmi():
	return map(float, stdin.readline().split())

def li():
	return list(mi())

def lsi():
	x = list(stdin.readline())
	x.pop()
	return x

def si():
	return stdin.readline()
for _ in range(ii()):
	n = ii()
	if n == 1:
		print(-1)
	else:
		print('5' * (n - 1) + '4')


import sys

class ABadUglyNumbers:

	def solve(self):
		for _ in range(int(input())):
			n = int(input())
			if n == 1:
				print(-1)
			else:
				ans = '4' * (n - 2) + '5' + '4'
				print(ans)
solver = ABadUglyNumbers()
input = sys.stdin.readline
solver.solve()


T = int(input())
outs = []
for i in range(T):
	n = int(input())
	if n == 1:
		outs.append(-1)
	else:
		z = n
		while len(str(z)) != 1:
			z = sum([int(x) for x in str(z)])
		if z == 1:
			a = '2' * (n - 2)
			for j in ['33', '37', '39', '73', '77', '79', '93', '97', '99']:
				b = int(a + j)
				if b % int(j) != 0:
					outs.append(b)
					break
		else:
			a = '2' * (n - 1)
			for j in ['3', '7', '9']:
				b = int(a + j)
				if b % int(j) != 0:
					outs.append(b)
					break
for i in outs:
	print(i)


T = int(input().strip())
for t in range(T):
	N = int(input().strip())
	if N == 1:
		print(-1)
	elif ((N - 1) * 2 + 3) % 3 == 0:
		print((N - 2) * '2' + '33')
	else:
		print((N - 1) * '2' + '3')


from sys import stdin, gettrace
if not gettrace():

	def input():
		return next(stdin)[:-1]

def main():

	def solve():
		n = int(input())
		if n == 1:
			print(-1)
			return
		num = int('2' * (n - 1) + '9')
		if num % 9 == 0:
			num = num + 70
		print(num)
	q = int(input())
	for _ in range(q):
		solve()
main()


for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print(-1)
	elif n % 3 == 2:
		n -= 2
		print('2' * n + '23')
	elif n % 3 == 0:
		n -= 3
		print('2' * n + '223')
	else:
		n -= 4
		print('2' * n + '2323')


from math import *
import random

def ra():
	return [int(i) for i in input().split()]
for zz in range(int(input())):
	n = int(input())
	if n == 1:
		print(-1)
	elif (n - 1) % 3 == 1:
		print('2' * (n - 2) + '4' + '3')
	elif (n - 1) % 3 == 2:
		print('2' * (n - 2) + '8' + '3')
	else:
		print('2' * (n - 2) + '6' + '3')


t = int(input())
while t:
	t -= 1
	n = int(input())
	if n == 1:
		print(-1)
		continue
	z = 2 * (n - 1)
	z += 3
	if z % 3:
		s = '2' * (n - 1) + '3'
	else:
		s = '2' * (n - 2) + '33'
	print(s)


for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print(-1)
	else:
		temp = '5'
		for i in range(n - 1):
			temp = temp + '7'
		print(temp)


t = int(input())
for i in range(t):
	n = int(input())
	if n == 1:
		print(-1)
	elif n == 2:
		print(27)
	else:
		print('3' * (n - 2), end='')
		print(53)


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, copy, functools
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
eps = 1.0 / 10 ** 10
mod = 10 ** 9 + 7
mod2 = 998244353
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return list(map(int, sys.stdin.readline().split()))

def LLI():
	return [list(map(int, l.split())) for l in sys.stdin.readlines()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().split()]

def LF():
	return [float(x) for x in sys.stdin.readline().split()]

def LS():
	return sys.stdin.readline().split()

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def S():
	return input()

def pf(s):
	return print(s, flush=True)

def pe(s):
	return print(str(s), file=sys.stderr)

def JA(a, sep):
	return sep.join(map(str, a))

def JAA(a, s, t):
	return s.join((t.join(map(str, b)) for b in a))

def main():
	t = I()
	rr = []
	for _ in range(t):
		n = I()
		if n < 2:
			rr.append(-1)
			continue
		r = [2] * (n - 1) + [3]
		if n % 3 == 1:
			r[-2] = 3
		rr.append(JA(r, ''))
	return JA(rr, '\n')
print(main())


import sys
cases = int(sys.stdin.readline())
for j in range(cases):
	solution = '-1'
	n = int(sys.stdin.readline())
	if n != 1:
		solution = '2'
		for i in range(n - 1):
			solution += '3'
	print(solution)


n = int(input())
a = '5'
b = '7'
for i in range(n):
	t = int(input())
	if t == 1:
		print(-1)
	else:
		print(a + (t - 1) * b)


from sys import stdin
input = stdin.readline
import math
for i in range(int(input())):
	n = int(input())
	if n == 1:
		print('-1')
	else:
		x = n - 1
		if x % 3 != 0:
			print('2' * x + '3')
		else:
			print('4' + '2' * (x - 1) + '3')


import sys
input = sys.stdin.readline
t = int(input())
for tt in range(t):
	n = int(input())
	if n == 1:
		print(-1)
		continue
	else:
		s = '5'
		s += '3' * (n - 1)
		print(s)


from sys import stdin, stdout
for _ in range(int(stdin.readline())):
	n = int(stdin.readline())
	if n == 1:
		print('-1')
	else:
		print(10 ** n - 2)


t = int(input())
for _ in range(t):
	n = int(input())
	if n == 1:
		print(-1)
	elif n == 2:
		print(57)
	else:
		tot = 3 + (n - 1) * 2
		r = ''
		if tot % 3 == 0:
			for _ in range(n - 2):
				r += '2'
			r += '33'
		else:
			for _ in range(n - 1):
				r += '2'
			r += '3'
		print(r)


def ans(n):
	if n == 1:
		return -1
	else:
		ans = ['2', '3' * (n - 1)]
		return int(''.join(ans))
for i in range(int(input())):
	print(ans(int(input())))


import sys
read = sys.stdin.buffer.readline
for _ in range(int(read())):
	n = int(read())
	print([-1, '2' + '3' * (n - 1)][n != 1])


n = int(input())
for i in range(n):
	t = int(input())
	if t == 1:
		print(-1)
	else:
		tmp = int('9' * (t - 1) + '7')
		if tmp % 7:
			print(tmp)
		else:
			print(tmp - 10)


t = int(input())
for query in range(t):
	n = int(input())
	if n == 1:
		print(-1)
	elif n % 2 == 1:
		print('4' + '54' * int((n - 1) / 2))
	else:
		print('54' * int(n / 2))


for _ in range(int(input())):
	s = int(input())
	if s == 1:
		print(-1)
	elif (s - 1) % 6 != 0:
		st = ''
		st = '5' * (s - 1)
		st += '7'
		print(st)
	else:
		st = ''
		st = '5' * (s - 2)
		st += '47'
		print(st)


def findTheNumber(n):
	if n == 1:
		print(-1)
		return
	for i in range(n - 1):
		print(5, end='')
	print(4)
for _ in range(int(input())):
	n = int(input())
	findTheNumber(n)


t = int(input())
for w in range(t):
	n = int(input())
	if n == 1:
		print(-1)
	else:
		s = '2'
		for i in range(1, n):
			if i % 2 != 0:
				s += '3'
			else:
				s += '9'
		print(s)


def answer(n):
	if n == 1:
		return -1
	return '2' + '3' * (n - 1)
testCount = int(input())
for _ in range(testCount):
	n = int(input())
	print(answer(n))


tc = int(input())
for t in range(0, tc):
	n = int(input())
	if n == 1:
		print(-1)
	else:
		for i in range(0, n - 1):
			print(9, end='')
		print(8)


import os
import sys
from io import BytesIO, IOBase
from math import log, floor, ceil

def main():
	for _ in range(int(input())):
		n = int(input())
		if n == 1:
			print(-1)
			continue
		elif n == 2:
			print(57)
			continue
		print('3' * (n - 1) + '8')
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


import sys
for t in range(int(input())):
	n = int(input())
	if n == 1:
		print(-1)
	elif (n - 1) % 3 == 0:
		print('2' * (n - 2) + '33')
	else:
		print('2' * (n - 1) + '3')


import sys
input = sys.stdin.readline
t = int(input())
for _ in range(t):
	n = int(input())
	ans = '2' + '3' * (n - 1) if n > 1 else '-1'
	print(ans)


import sys
t = int(sys.stdin.readline())
for _ in range(t):
	n = int(sys.stdin.readline())
	if n == 1:
		print('-1')
	else:
		x = 10 ** n
		x -= 2
		print(x)


for _ in range(int(input())):
	digits = int(input())
	if digits == 1:
		print(-1)
	else:
		print('23' + '3' * (digits - 2))


i = int(input())
for j in range(0, i):
	a = int(input())
	if a > 1:
		print(str(2) + str(3) * (a - 1))
	else:
		print(-1)


import sys
import math
get_string = lambda : sys.stdin.readline().strip()
get_int_list = lambda : list(map(int, sys.stdin.readline().strip().split()))
get_int = lambda : int(sys.stdin.readline())
pt = lambda x: sys.stdout.write(str(x) + '\n')
for i in range(get_int()):
	n = get_int()
	if n == 1:
		print(-1)
	else:
		print('2' + '3' * (n - 1))


def solve(n):
	if n == 1:
		return -1
	return int('9' * (n - 1) + '8')

def main():
	t = int(input())
	for _ in range(t):
		n = int(input())
		print(solve(n))
main()


for i in range(int(input())):
	n = int(input())
	if n == 1:
		print(-1)
	elif n >= 2:
		print('2' + '3' * (n - 1))


from bisect import *
from collections import *
from itertools import *
import functools
import sys
import math
from decimal import *
from copy import *
from heapq import *
from fractions import *
getcontext().prec = 30
MAX = sys.maxsize
MAXN = 500010
MOD = 10 ** 9 + 7
spf = [i for i in range(MAXN)]
spf[0] = spf[1] = -1

def sieve():
	for i in range(2, MAXN, 2):
		spf[i] = 2
	for i in range(3, int(MAXN ** 0.5) + 1):
		if spf[i] == i:
			for j in range(i * i, MAXN, i):
				if spf[j] == j:
					spf[j] = i

def fib(n, m):
	if n == 0:
		return [0, 1]
	else:
		(a, b) = fib(n // 2)
		c = a % m * (b % m * 2 - a % m) % m
		d = a % m * (a % m) % m + b % m * b % m % m
		if n % 2 == 0:
			return [c, d]
		else:
			return [d, c + d]

def charIN(x=' '):
	return sys.stdin.readline().strip().split(x)

def arrIN(x=' '):
	return list(map(int, sys.stdin.readline().strip().split(x)))

def ncr(n, r):
	num = den = 1
	for i in range(r):
		num = num * (n - i) % MOD
		den = den * (i + 1) % MOD
	return num * pow(den, MOD - 2, MOD) % MOD

def flush():
	return sys.stdout.flush()
for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print(-1)
	else:
		if (n - 1) % 3 == 0:
			ans = '2' * (n - 2) + '33'
		else:
			ans = '2' * (n - 1) + '3'
		print(ans)


t = int(input())
for i in range(0, t):
	n = int(input())
	s = ''
	if n == 1:
		print('-1')
	elif n % 2 == 0:
		for i in range(1, n):
			s = s + '6'
		s = s + '7'
		print(s)
	else:
		for i in range(1, n):
			s = s + '3'
		s = s + '4'
		print(s)


nums = int(input())
for i in range(nums):
	n = int(input())
	if n == 1:
		print(-1)
		continue
	print('9' * (n - 1) + '8')


T = int(input())
for i in range(T):
	n = int(input())
	if n == 1:
		print('-1')
	else:
		print(10 ** n - 2)


t = int(input())
while t:
	n = int(input())
	if n == 1:
		print(-1)
	elif n == 2:
		print(23)
	else:
		print('9' * (n - 3) + '239')
	t -= 1


t = int(input())
while t > 0:
	t = t - 1
	n = int(input())
	if n == 1:
		print('-1')
	else:
		print('6' + (n - 1) * '9')


t = int(input())
for sai in range(t):
	n = int(input())
	if n == 1:
		print(-1)
	else:
		s = '2'
		for z in range(n - 1):
			s = s + '3'
		print(s)


n = int(input())
for i in range(n):
	t = int(input())
	if t == 1:
		print('-1')
	else:
		bh = '5'
		while t > 1:
			bh = bh + '9'
			t = t - 1
		print(bh)


t = int(input())
for i in range(t):
	n = int(input())
	a = '2'
	if n == 1:
		print(-1)
		continue
	else:
		for j in range(1, n):
			a += '3'
	print(a)


k = int(input())
while k:
	k -= 1
	n = int(input())
	if n == 1:
		ugly = str(-1)
	else:
		for i in range(n):
			if i == 0:
				ugly = str(2)
			else:
				ugly += str(3)
	print(ugly)


for _testcases_ in range(int(input())):
	n = int(input())
	start = 5
	if n == 1:
		print(-1)
	else:
		for i in range(n):
			if i != n - 1:
				print('5', end='')
			else:
				print('4', end='')
		print()


t = int(input())
while t > 0:
	n = int(input())
	if n == 1:
		print(-1)
	else:
		for x in range(n - 2):
			print(6, end='')
		print(23)
	t -= 1


t = int(input())
while t != 0:
	n = int(input())
	ans = str(2)
	for i in range(n - 2, 0, -1):
		ans = ans + str(3)
	if n == 1:
		print(-1)
	else:
		print(int(ans + str(3)))
	t = t - 1


t = int(input())
answers = []
while t > 0:
	t = t - 1
	n = int(input())
	r = n % 3
	if n == 1:
		answers.append(-1)
	elif r == 2 or r == 0:
		answers.append('2' * (n - 1) + '3')
	elif r == 1:
		answers.append('2' * (n - 2) + '73')
for i in answers:
	print(i)


t = int(input())
for __ in range(t):
	n = int(input())
	if n == 1:
		print(-1)
	else:
		ls = []
		for i in range(n - 1):
			ls.append(2)
		if (n - 1) % 3 == 0:
			ls[0] += 2
		ls.append(3)
		print(''.join(map(str, ls)))


import math
t = int(input())
for _ in range(t):
	n = int(input())
	if n == 1:
		print(-1)
	else:
		a = '5' + (n - 1) * '7'
		print(int(a))


def main():
	t = int(input())
	for _ in range(t):
		n = int(input())
		if n == 1:
			print(-1)
			continue
		else:
			a = (n - 1) * '9'
			a += '8'
			print(a)
main()