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
a = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
l = [0]*(365)
k = 0
for i in xrange(1,len(a)):
	for j in xrange(a[i]):
		l[k]=i
		k+=1
tc = int(raw_input())
while (tc>0):
	tc = tc - 1
	k = int(raw_input())
	print l[k-1]