X = int(eval(input()))

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

dp = [[-1 for _ in range(X+1)] for _ in range(7)]

for i in range(1,7):

    dp[i][0] = 10**6

for i in range(1,7):

    for j in range(1,X+1):

        if dp[i-1][j]>=0:

            dp[i][j] = 10**6

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

            dp[i][j] = -1

        else:

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

if dp[6][X]>=0:

    print((1))

else:

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

x = X%100

cnt = 0

cnt += x//5

x = x%5

cnt += x//4

x = x%4

cnt += x//3

x = x%3

cnt += x//2

x = x%2

cnt += x

X = X-X%100

if X>=100*cnt:

    print((1))

else:

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

X = int(eval(input()))
x = X % 100
cnt = 0
cnt += x // 5
x = x % 5
cnt += x // 4
x = x % 4
cnt += x // 3
x = x % 3
cnt += x // 2
x = x % 2
cnt += x
X = X - X % 100
if X >= 100 * cnt:
    print((1))
else:
    print((0))

-A = [100, 101, 102, 103, 104, 105] -dp = [[-1 for _ in range(X + 1)] for _ in range(7)] -for i in range(1, 7): -    dp[i][0] = 10**6 -for i in range(1, 7): -    for j in range(1, X + 1): -        if dp[i - 1][j] >= 0: -            dp[i][j] = 10**6 -        elif j < A[i - 1] or dp[i][j - A[i - 1]] <= 0: -            dp[i][j] = -1 -        else: -            dp[i][j] = dp[i][j - A[i - 1]] - 1 -if dp[6][X] >= 0: +x = X % 100 +cnt = 0 +cnt += x // 5 +x = x % 5 +cnt += x // 4 +x = x % 4 +cnt += x // 3 +x = x % 3 +cnt += x // 2 +x = x % 2 +cnt += x +X = X - X % 100 +if X >= 100 * cnt: