Problem: In vardhaman college of engineering, there is competition with name treasure lock.
To make this competition the key for the lock should satisfy following rules.
1 .3, 5, or both as its digits. No other digit is allowed.
2. Number of times 3 appears is divisible by 5.
3. Number of times 5 appears is divisible by 3.

Rakesh is very eager to win the championship. He is developing a code for that key.Assume yourself in that situation and solve for the key.

INPUT:
first line contains T testcases.
Next T lines consists of the number.
OUTPUT:
Output the number satisfying the above conditions.
if n cannot satisfy the above conditions print -1.

0<t<10
0<n<1000

SAMPLE INPUT
4
1
3
5
17

SAMPLE OUTPUT
-1
555
33333
55555555555533333

Solution (in PYTHON):

Solution:
import sys
t=int(raw_input())
while t>0:
	n=int(raw_input())
	if n>=0 and n<=2:
		print -1
		t-=1
		continue
	else:
		if(n%3==0):
			z=n
			i=0
			while i<z:
				sys.stdout.write('5')
				i+=1
		elif (n%5==0):
			q=n
			j=0
			while j<q:
				sys.stdout.write('3')
				j+=1
		else:
			a=n-5
			b=5
			if a%3==0:
				i=0
				j=0
				while i<a:
					sys.stdout.write('5')
					i+=1
				while j<b:
					sys.stdout.write('3')
					j+=1
			else:
				print -1
	t-=1
	print