x = int(eval(input()))



dp = [False] * (x+1)

dp[0] = True

for i in range(1,x+1):

    if i < 99:

        continue

    else:

        if dp[i-100]:

            dp[i] = True

        elif dp[i-101]:

            dp[i] = True

        elif dp[i-102]:

            dp[i] = True

        elif dp[i-103]:

            dp[i] = True

        elif dp[i-104]:

            dp[i] = True

        elif dp[i-105]:

            dp[i] = True



if dp[x]:

    print((1))

else:

    print((0))
a = int(eval(input()))

tmp01 = a/100

tmp02 = a/105

n = a//100

#print(tmp01,n,tmp02)

if tmp01 >= n >= tmp02:

  print((1))

else:

  print((0))
x = int(eval(input()))
dp = [False] * (x + 1)
dp[0] = True
for i in range(1, x + 1):
    if i < 99:
        continue
    else:
        if dp[i - 100]:
            dp[i] = True
        elif dp[i - 101]:
            dp[i] = True
        elif dp[i - 102]:
            dp[i] = True
        elif dp[i - 103]:
            dp[i] = True
        elif dp[i - 104]:
            dp[i] = True
        elif dp[i - 105]:
            dp[i] = True
if dp[x]:
    print((1))
else:
    print((0))

a = int(eval(input()))
tmp01 = a / 100
tmp02 = a / 105
n = a // 100
# print(tmp01,n,tmp02)
if tmp01 >= n >= tmp02:
    print((1))
else:
    print((0))

-x = int(eval(input())) -dp = [False] * (x + 1) -dp[0] = True -for i in range(1, x + 1): -    if i < 99: -        continue -    else: -        if dp[i - 100]: -            dp[i] = True -        elif dp[i - 101]: -            dp[i] = True -        elif dp[i - 102]: -            dp[i] = True -        elif dp[i - 103]: -            dp[i] = True -        elif dp[i - 104]: -            dp[i] = True -        elif dp[i - 105]: -            dp[i] = True -if dp[x]: +a = int(eval(input())) +tmp01 = a / 100 +tmp02 = a / 105 +n = a // 100 +# print(tmp01,n,tmp02) +if tmp01 >= n >= tmp02: