import sys lim = 10**5 def solve(): btm = 0 top = lim while btm != top: d = (top - btm) // 3 print(0, btm + d, flush=True) a1 = int(input()) if a1 == 0: return print(0, top - d, flush=True) a2 = int(input()) if a2 == 0: return if d == 0: if a1 < a2: top -= 1 else: btm += 1 else: if a1 < a2: top = top - d else: btm = btm + d print(0, btm, flush=True) a = int(input()) if a == 0: return print(a, btm, flush=True) a = int(input()) return if __name__ == '__main__': solve()