Abhishek is a computer science student at the Department of computer science India His teacher recently gave him a single assignment with only a single problem.

The problem was simple.He has to find out the min number of single digit prime numbers which when added equals a given number Y.

Input:

The first line contains T denoting the number of test cases. Each of the next T lines contains a single integer Y.

Output:

Print the min number required. If he can not obtain Y using single digit prime numbers, output -1.

SAMPLE INPUT
4
5
9
12
19

SAMPLE OUTPUT
1
2
2
3

Explanation

Explanation:

5= Itself a prime number so 1.

9=2+7

12=5+7

19=5+7+7
t = int(raw_input())

prim = [1,2,3,5,7]

for i in range(t):
	n = int(raw_input())

	if n<1:
		print -1
		continue

	dp = []*n
	sumi = 0
	sumi+=n/7
	n%=7

	if n==1 or n==2 or n==3 or n==5:
		sumi+=1
	elif n:
		sumi+=2

	print sumi