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())
n=x//100
m=x//105
print(n,m)
for i in range(m,n+1):
  if 100*i<=x<=105*i:
    print(1)
    exit()
print(0)
x=int(input())
n=x//100
m=x//105
for i in range(m,n+1):
  if 100*i<=x<=105*i:
    print(1)
    exit()
print(0)