X = int(eval(input()))

t = X%100

k = X//100



if k*5 >= t:

    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()))
t = X % 100
k = X // 100
if k * 5 >= t:
    print((1))
else:
    print((0))

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

-t = X % 100 -k = X // 100 -if k * 5 >= t: +t = X // 100 +if 0 <= X % 100 <= t * 5: