# cook your dish here
x = [0, 0, 1, 0, 2, 0, 2, 2, 1, 6, 0, 5, 0, 2, 6, 5, 4, 0, 5, 3, 0, 3, 2, 9, 0, 4, 9, 3, 6, 14, 0, 6, 3, 5, 15, 0, 5, 3, 5, 2, 17, 0, 6, 11, 0, 3, 8, 0, 3, 3, 1, 42, 0, 5, 15, 20, 0, 4, 32, 0, 3, 11, 18, 0, 4, 7, 0, 3, 7, 3, 2, 31, 0, 6, 31, 3, 6, 3, 2, 8, 33, 0, 9, 56, 0, 3, 8, 7, 19, 0, 5, 37, 0, 3, 8, 8, 1, 46, 0, 6, 23, 0, 3, 9, 21, 0, 4, 42, 56, 25, 0, 5, 21, 8, 18, 52, 0, 6, 18, 4, 13, 0, 5, 11, 62, 0, 4, 7, 40]
t = int(input())
for i in range(t):
s = int(input())
count = 1
for j in range(0, s-1, 1):
if x[s-1]==x[j]:
count+=1
else:
continue
print(count)
276D - Little Girl and Maximum XOR | 1253C - Sweets Eating |
1047A - Little C Loves 3 I | 758D - Ability To Convert |
733A - Grasshopper And the String | 216A - Tiling with Hexagons |
1351B - Square | 1225A - Forgetting Things |
1717A - Madoka and Strange Thoughts | 1717B - Madoka and Underground Competitions |
61B - Hard Work | 959B - Mahmoud and Ehab and the message |
802G - Fake News (easy) | 1717C - Madoka and Formal Statement |
420A - Start Up | 1031A - Golden Plate |
1559C - Mocha and Hiking | 427B - Prison Transfer |
330A - Cakeminator | 426A - Sereja and Mugs |
363A - Soroban | 1585C - Minimize Distance |
1506E - Restoring the Permutation | 1539A - Contest Start |
363D - Renting Bikes | 1198D - Rectangle Painting 1 |
1023B - Pair of Toys | 1725A - Accumulation of Dominoes |
1675E - Replace With the Previous Minimize | 839A - Arya and Bran |