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
from sys import stdin
tc= raw_input()
for i in stdin:
	i = int(i)
	#print i
	if i <= 31:					#january
		print "1"
	elif i > 31 and i <= 59:	#february
		print "2"
	elif i > 59 and i <= 90:	#march
		print "3"
	elif i > 90 and i <= 120:	#april
		print "4"
	elif i > 120 and i <= 151:	#may
		print "5"
	elif i > 151 and i <= 181:	#june
		print "6"
	elif i > 181 and i <= 212:#july
		print "7"
	elif i > 212 and i <= 243:#august
		print "8"
	elif i > 243 and i <= 273:#september
		print "9"
	elif i > 273 and i <= 304:#october
		print "10"
	elif i > 304 and i <= 334:#november
		print "11"
	else:
		print "12"