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 i in xrange(input()):
	num = input()
	if num>=1 and num <=31:
		print "1"
	elif num >31 and num <=59:
		print "2"
	elif num >59 and num <=90:
		print "3"
	elif num >90 and num <=120:
		print "4"
	elif num >120 and num <=151:
		print "5"
	elif num >151 and num <=181:
		print "6"
	elif num >181 and num <=212:
		print "7"
	elif num >212 and num <=243:
		print "8"
	elif num >243 and num <=273:
		print "9"
	elif num >273 and num <=304:
		print "10"
	elif num >304 and num <=334:
		print "11"
	else:
		print "12"