X = int(eval(input()))

t = X//100

if 0 <= X%100 <= t*5:

    print((1))

else:

    print((0))

X = int(eval(input()))

if 0 <= X%100 <= 5*(X//100):

    print((1))

else:

    print((0))

X = int(eval(input()))
t = X // 100
if 0 <= X % 100 <= t * 5:
    print((1))
else:
    print((0))

X = int(eval(input()))
if 0 <= X % 100 <= 5 * (X // 100):
    print((1))
else:
    print((0))

-t = X // 100 -if 0 <= X % 100 <= t * 5: +if 0 <= X % 100 <= 5 * (X // 100):