sol = list()

MAX = 100
n = (1918, 1921, 1920, 1924, 1953, 1968)

for a in range(MAX):
    for b in range(MAX):
        for c in range(MAX):
            sol.append((2**a)*(3**b)*(5**c))

sol = sorted(sol)

for i in n:
    print(i, sol[7*i-1])


