Solve the mystery.

Input

The first line contains T, the number of test cases.

T lines follow each containing a single integer N.

Output

Output the answer for each test case in a new line.

Constraints

1 ≤ T ≤ 10^5

1 ≤ N ≤ 365

NOTE

There is partial marking for this question

SAMPLE INPUT
5
10
60
100
200
360

SAMPLE OUTPUT
1
3
4
7
12
for _ in range(input()):
	n=input()
	if n in range(1,32):
		print 1
	elif n in range(32,60):
		print 2
		
	elif n in range(60,91):
		print 3
	
	elif n in range(91,121):
		print 4
	elif n in range(121,152):
		print 5
	elif n in range(152,182):
		print 6
	elif n in range(182,213):
		print 7
	elif n in range(213,244):
		print 8
	elif n in range(244,274):
		print 9
	elif n in range(274,305):
		print 10
	elif n in range(305,335):
		print 11
	elif n in range(335,365):
		print 12