d = map(int, input("50000 50000\n")) up = int(input("50000 40000\n")) down = int(input("50000 60000\n")) left = int(input("40000 50000\n")) right = int(input("60000 50000\n")) 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) while True: mx = int(input("%d %d\n"%(x+(d*x_sign),y))) my = int(input("%d %d\n"%(x, y+(d*y_sign)))) if mx==my: x_sign*=-1 y_sign*=-1 elif mx