print("50000 50000") d = int(input()) print("50000 40000") up = int(input()) print("50000 60000") down = int(input()) print("40000 50000") left = int(input()) print("60000 50000") right = int(input()) if d+10000==up: y_sign = 1 else: y_sign = -1 if d+10000==left: x_sign = 1 else: x_sign = -1 x, y = (50000, 50000) prev = d eq = False while True: if eq: newx = x+d*x_sign newy = y+d*y_sign eq = False else: newx = x+d*x_sign newy = y+d*y_sign print("%d %d"%(newx,y)) mx = int(input()) if mx==0: break print("%d %d"%(x, newy)) my = int(input()) if my == 0: break if mx > prev: x_sign *= -1 if my > prev: y_sign *= -1 if mx==my: eq = True elif mx