X = int(eval(input()))



dp = [-1] * (X + 1)

a = [100, 101, 102, 103, 104, 105]

m = [1000000] * 6

dp[0] = 0

for i in range(6):

    for j in range(X + 1):

        if dp[j] >= 0:

            dp[j] = m[i]

        elif j < a[i] or dp[j - a[i]] <= 0:

            dp[j] = -1

        else:

            dp[j] = dp[j - a[i]] - 1

            

print((int(dp[-1] >= 0)))



X = int(eval(input()))



n = X % 100

m = X // 100



cnt = 0

for a in reversed(list(range(1, 6))):

    while n - a >= 0:

        n -= a

        cnt += 1



if cnt <= m:

    print((1))

else:

    print((0))

X = int(eval(input()))
dp = [-1] * (X + 1)
a = [100, 101, 102, 103, 104, 105]
m = [1000000] * 6
dp[0] = 0
for i in range(6):
    for j in range(X + 1):
        if dp[j] >= 0:
            dp[j] = m[i]
        elif j < a[i] or dp[j - a[i]] <= 0:
            dp[j] = -1
        else:
            dp[j] = dp[j - a[i]] - 1
print((int(dp[-1] >= 0)))

X = int(eval(input()))
n = X % 100
m = X // 100
cnt = 0
for a in reversed(list(range(1, 6))):
    while n - a >= 0:
        n -= a
        cnt += 1
if cnt <= m:
    print((1))
else:
    print((0))

-dp = [-1] * (X + 1) -a = [100, 101, 102, 103, 104, 105] -m = [1000000] * 6 -dp[0] = 0 -for i in range(6): -    for j in range(X + 1): -        if dp[j] >= 0: -            dp[j] = m[i] -        elif j < a[i] or dp[j - a[i]] <= 0: -            dp[j] = -1 -        else: -            dp[j] = dp[j - a[i]] - 1 -print((int(dp[-1] >= 0))) +n = X % 100 +m = X // 100 +cnt = 0 +for a in reversed(list(range(1, 6))): +    while n - a >= 0: +        n -= a +        cnt += 1 +if cnt <= m: +    print((1)) +else: +    print((0))