def is_in_interval(n):
    return (-15 < n <= 12) or (14 < n < 17) or (19 <= n)


print(is_in_interval(int(input())))

def is_in_interval(n):
    return (-15 < n <= 12) or (14 < n < 17) or (19 <= n)


print(is_in_interval(int(input())))
