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
import sys
def month_determiner(day):
	day = int(day)
	if (1<=day<=31):
		return 1
	if (32<=day<=59):
		return 2
	if (60<=day<=90):
		return 3
	if (91<=day<=120):
		return 4
	if (121<=day<=151):
		return 5
	if (152<=day<=181):
		return 6
	if (182<=day<=212):
		return 7
	if (213<=day<=243):
		return 8
	if (244<=day<=273):
		return 9
	if (274<=day<=304):
		return 10
	if (305<=day<=334):
		return 11
	if (335<=day<=365):
		return 12

def main():
	t=int(raw_input());
	while(t>0):
		day_input = raw_input()
		print month_determiner(day_input)
		t = t-1
	
if __name__ == "__main__" :
	main()