ng=10**9 ok=0 test=10**9//2 print(10**9//2) for i in range(30): x=int(input()) if x==1: break elif x==0: ng=test elif x==-1: break print((ok+ng)//2)