X = int(eval(input()))

dp = [0]*(X+1)

dp[0] = 1



for i in range(X+1):

    for j in [100, 101, 102, 103, 104, 105]:

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

            dp[i] = 1



print((dp[X]))
X = int(eval(input()))

dp = [0]*(X+1)

dp[0] = 1



for i in range(100, X+1):

    dp[i] = dp[i-100] or dp[i-101] or dp[i-102] or dp[i-103] or dp[i-104] or dp[i-105]



print((dp[X]))
X = int(eval(input()))
dp = [0] * (X + 1)
dp[0] = 1
for i in range(X + 1):
    for j in [100, 101, 102, 103, 104, 105]:
        if i - j >= 0 and dp[i - j]:
            dp[i] = 1
print((dp[X]))

X = int(eval(input()))
dp = [0] * (X + 1)
dp[0] = 1
for i in range(100, X + 1):
    dp[i] = (
        dp[i - 100]
        or dp[i - 101]
        or dp[i - 102]
        or dp[i - 103]
        or dp[i - 104]
        or dp[i - 105]
    )
print((dp[X]))

-for i in range(X + 1): -    for j in [100, 101, 102, 103, 104, 105]: -        if i - j >= 0 and dp[i - j]: -            dp[i] = 1 +for i in range(100, X + 1): +    dp[i] = ( +        dp[i - 100] +        or dp[i - 101] +        or dp[i - 102] +        or dp[i - 103] +        or dp[i - 104] +        or dp[i - 105] +    )