The input contains a single integer *a* (1 ≤ *a* ≤ 40).

Output a single string.
The input contains a single integer *a* (1 ≤ *a* ≤ 40).
# from collections import defaultdict,deque
# from sys import stdin
# import itertools
# import bisect
# from math import sqrt,ceil,floor,gcd,sin,radians
# from sortedcontainers import SortedList


def func(put,mapping,unpack):
    presidents = ["Washington", "Adams", "Jefferson" , "Madison" , "Monroe" , "Adams" , "Jackson" , "Van Buren", "Harrison" , "Tyler" , "Polk" , "Taylor" , "Fillmore" , "Pierce", "Buchanan" , "Lincoln", "Johnson" , "Grant" , "Hayes" , "Garfield" , "Arthur" , "Cleveland", "Harrison" , "Cleveland" , "McKinley" , "Roosevelt" , "Taft" , "Wilson" , "Harding" , "Coolidge", "Hoover" , "Roosevelt" , "Truman" , "Eisenhower" , "Kennedy" , "Johnson" , "Nixon" , "Ford", "Carter" , "Reagan" , "Bush" , "Clinton"
    ]
    print(presidents[put(int)-1])

def init(TestCases=True):
    put = lambda s: s(input().strip())
    mapping = lambda s: list(map(s,input().split()))
    unpack = lambda s: map(s,input().split())
    for _ in range(int(input()) if TestCases else 1):
        func(put,mapping,unpack)

if __name__ == '__main__':
    init(False)