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
n = int(raw_input())
while n != 0:
	value = int(raw_input())
	if  value <= 31:
		print '1'
	elif value<= 59:
		print '2'
	elif   value <= 90:
		print '3'
	elif   value <= 120:
		print '4'
	elif   value <= 151:
		print '5'
	elif   value <= 181:
		print '6'
	elif   value <= 212:
		print '7'
	elif   value <= 243:
		print '8'
	elif   value <= 273:
		print '9'
	elif   value <= 304:
		print '10'
	elif   value <= 334:
		print '11'
	else:
		print '12'
	n=n-1