def center_pos(dic: dict): x = 0 y = 0 for p in dic: x += p[0] y += p[1] return int(x / 4), int(y / 4) def minimum_distance(dic: dict): min_dis = 100001 min_pos = () for p in dic: if dic[p] < min_dis: min_dis = dic[p] min_pos = p return min_pos def get_distance(p): print("{0} {1}".format(p[0], p[1]), flush=True) d = int(input()) if d == 0: exit() return d if __name__ == "__main__": init_pos_list = [(0, 0), (0, 100000), (100000, 0), (100000, 100000)] pos_dis_dic = {} for pos in init_pos_list: dis = get_distance(pos) pos_dis_dic[pos] = dis while True: cp = center_pos(pos_dis_dic) distance = get_distance(cp) min_dis_pos = minimum_distance(pos_dis_dic) min_dis = pos_dis_dic[min_dis_pos] pos_dis_dic.clear() pos_dis_dic[min_dis_pos] = min_dis pos_dis_dic[cp] = distance pos_a = (min_dis_pos[0], cp[1]) pos_b = (cp[0], min_dis_pos[1]) pos_dis_dic[pos_a] = get_distance(pos_a) pos_dis_dic[pos_b] = get_distance(pos_b)