from collections import defaultdict, Counter, deque from itertools import groupby, accumulate, combinations, permutations, product, combinations_with_replacement from bisect import bisect_left, bisect_right from operator import itemgetter import math from heapq import heapify, heappush, heappop LMI=lambda:list(map(int, input().split())) LMS=lambda:list(map(str, input().split())) MI=lambda:map(int, input().split()) MS=lambda:map(str, input().split()) II=lambda:int(input()) IS=lambda:input().split() LI=lambda:list(input()) ok, ng = 10**9, 0 while True: #真ん中の値を計算 mi = (ok + ng) // 2 print(mi) r=II() if r==1 or r==-1: exit() elif r==0: ok = mi