AtCoder Mart sells 1000000 of each of the six items below:    * Riceballs, priced at 100 yen (the currency of Japan) each   * Sandwiches, priced at 101 yen each   * Cookies, priced at 102 yen each   * Cakes, priced at 103 yen each   * Candies, priced at 104 yen each   * Computers, priced at 105 yen each  Takahashi wants to buy some of them that cost exactly X yen in total. Determine whether this is possible.   (Ignore consumption tax.)
x = int(input())
for i in range(5, 0, -1):
    x -= (100 + i) * ((x % 100) // i)
    print(x)
    if x < 0:
        print(0)
        exit()
if x % 100:
    print(0)
else:
    print(1)

x = int(input())
for i in range(5, 0, -1):
    x -= (100 + i) * ((x % 100) // i)
    if x < 0:
        print(0)
        exit()
if x % 100:
    print(0)
else:
    print(1)
