def main(): xmin = 0 #xmax = 100000 xmax = 5 while True: x = xmin + (xmax - xmin) // 2 print(x, 0) ret1 = int(input()) print(x + 1, 0) ret2 = int(input()) if ret1 < ret2: xmax = x else: xmin = x if xmax - xmin == 1: print(xmin, 0) ret1 = int(input()) print(xmax, 0) ret2 = int(input()) if ret1 < ret2: x = xmin y = ret1 else: x = xmax y = ret2 break print(x, y) main()