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
T=input()
while(T):
	T-=1
	N=input()
	if(N>=1 and N<=31):
		print "1"
	elif(N>31 and N<=59):
		print "2"
	elif(N>=60 and N<=90):
		print "3"
	elif(N>=91 and N<=120):
		print "4"
	elif(N>=121 and N<=151):
		print "5"
	elif(N>=152 and N<=181):
		print "6"
	elif(N>=182 and N<=212):
		print "7"
	elif(N>=213 and N<=243):
		print "8"
	elif(N>=244 and N<=273):
		print "9"
	elif(N>=274 and N<=304):
		print "10"
	elif(N>=305 and N<=334):
		print "11"
	elif(N>=335 and N<=365):
		print "12"