x = int(eval(input()))



max_a = (x // 100) + 1

max_b = (x // 101) + 1

max_c = (x // 102) + 1

max_d = (x // 103) + 1

max_e = (x // 104) + 1



for a in range(max_a):

  for b in range(max_b):

    for c in range(max_c):

      for d in range(max_d):

        for e in range(max_e):

          for_f = x - (a * 100 + b * 101 + c * 102 + d * 103 + e * 104)

          if for_f >= 0 and for_f % 105 == 0:

            # print(a, b, c, d, e, for_f // 105)

            print('1')

            exit(0)

print('0')

x = int(eval(input()))

c = int(x / 100)

# print(c)



for i in range(c * 100, c * 105 + 1):

  if i == x:

    print((1))

    exit(0)

print((0))

x = int(eval(input()))
max_a = (x // 100) + 1
max_b = (x // 101) + 1
max_c = (x // 102) + 1
max_d = (x // 103) + 1
max_e = (x // 104) + 1
for a in range(max_a):
    for b in range(max_b):
        for c in range(max_c):
            for d in range(max_d):
                for e in range(max_e):
                    for_f = x - (a * 100 + b * 101 + c * 102 + d * 103 + e * 104)
                    if for_f >= 0 and for_f % 105 == 0:
                        # print(a, b, c, d, e, for_f // 105)
                        print("1")
                        exit(0)
print("0")

x = int(eval(input()))
c = int(x / 100)
# print(c)
for i in range(c * 100, c * 105 + 1):
    if i == x:
        print((1))
        exit(0)
print((0))

-max_a = (x // 100) + 1 -max_b = (x // 101) + 1 -max_c = (x // 102) + 1 -max_d = (x // 103) + 1 -max_e = (x // 104) + 1 -for a in range(max_a): -    for b in range(max_b): -        for c in range(max_c): -            for d in range(max_d): -                for e in range(max_e): -                    for_f = x - (a * 100 + b * 101 + c * 102 + d * 103 + e * 104) -                    if for_f >= 0 and for_f % 105 == 0: -                        # print(a, b, c, d, e, for_f // 105) -                        print("1") -                        exit(0) -print("0") +c = int(x / 100) +# print(c) +for i in range(c * 100, c * 105 + 1): +    if i == x: +        print((1)) +        exit(0) +print((0))