n=int(eval(input()));print((+(n//100*5>=n%100)))
n=int(eval(input()));print((+(n%100*21<=n)))
n = int(eval(input()))
print((+(n // 100 * 5 >= n % 100)))

n = int(eval(input()))
print((+(n % 100 * 21 <= n)))

-print((+(n // 100 * 5 >= n % 100))) +print((+(n % 100 * 21 <= n)))