l,r = 0,10**9+1 while r-l > 1: mid = (l+r)//2 print(mid) if int(input()) == 0: r = mid else: exit()