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