def Question(X): print("? {}".format(X),flush=True) return input()=="safe" def Answer(X): print("! {}".format(X),flush=True) exit() #============================================== L,R=0,1001 while R-L>1: C=L+(R-L)//2 p=Question(C) if not p: q=Question(C+1) if q: L=C else: R=C else: L=C Answer(L)