print(((51,1,4,1,4,5,2,2,15,1,2,2,5,1,5,1,14,1,2,1,5,1,2,2,5,1,2,1,2,1,1,1)[-int(eval(input()))]))
print((ord(' 3    '[int(eval(input()))%14])))
print(
    (
        (
            51,
            1,
            4,
            1,
            4,
            5,
            2,
            2,
            15,
            1,
            2,
            2,
            5,
            1,
            5,
            1,
            14,
            1,
            2,
            1,
            5,
            1,
            2,
            2,
            5,
            1,
            2,
            1,
            2,
            1,
            1,
            1,
        )[-int(eval(input()))]
    )
)

print((ord(" 3    "[int(eval(input())) % 14])))

-print( -    ( -        ( -            51, -            1, -            4, -            1, -            4, -            5, -            2, -            2, -            15, -            1, -            2, -            2, -            5, -            1, -            5, -            1, -            14, -            1, -            2, -            1, -            5, -            1, -            2, -            2, -            5, -            1, -            2, -            1, -            2, -            1, -            1, -            1, -        )[-int(eval(input()))] -    ) -) +print((ord(" 3    "[int(eval(input())) % 14])))