def main(): xmin = 0 xmax = 100000 print(xmax // 2 + 1, 0) y = int(input()) while True: x = xmin + (xmax - xmin) // 2 print(x, 0) ret = int(input()) if y < ret: xmin = x else: xmax = x y = min(y, ret) if ret == 0 or xmin == xmax: break print(x, y) main()