memo = {} def query(x, y): if (x, y) in memo: return memo[(x, y)] print(x, y, flush=True) d = int(input()) if d == 0: exit() memo[(x, y)] = d return d yl = 0 yr = 10**5 while yl+2 < yr: y1 = (2*yl+yr)//3 y2 = (yl+2*yr)//3 if query(0, y1) <= query(0, y2): yr = y2 else: yl = y1 minv = 10**18 ay = -1 for y in range(yl, yr+1): d = query(0, y) if d < minv: ay = y minv = d ax = minv query(ax, ay)