# -*- coding: utf-8 -*- """ No.513 宝探し2 https://yukicoder.me/problems/no/513 """ import sys from sys import stdin input = stdin.readline def check_distance(x, y): print(x, y, flush=True) dist = int(input()) return dist def main(args): dist = check_distance(0, 0) lx = 0 rx = dist lx_update = True rx_update = True while dist != 0: if lx_update: ldist = check_distance(lx, dist - lx) lx_update = False if ldist == 0: break if rx_update: rdist = check_distance(rx, dist - rx) rx_update = False if rdist == 0: break if ldist == rdist: lx = (lx + rx) // 2 lx_update = True elif ldist < rdist: rx = (lx + rx) // 2 rx_update = True else: lx = (lx + rx) // 2 lx_update = True if __name__ == '__main__': main(sys.argv[1:])