void main(){
  import std.stdio, std.string, std.conv, std.algorithm;
  import std.exception;

  int n; rd(n);
  void q(int i){
    writeln(i); stdout.flush();
  }
  const M=0, F=1, V=-1;
  int read(){
    auto t=readln.chomp.to!(char[]);
    if(t[0]=='M') return M;
    else if(t[0]=='F') return F;
    else return V;
  }

  int l=0, r=n-1;
  q(l); auto ls=read();
  if(ls==V) return;
  q(r); auto rs=read();
  if(rs==V) return;

  void fun(int l, int ls, int r, int rs){
    if((r-l+1)&1){ // odd
      enforce(ls!=rs);
      auto m=(r+l)/2;
      q(m); auto ms=read();
      if(ms==-1) return;
      if(ls==ms) fun(l, ls, m, ms);
      else if(ms==rs) fun(m, ms, r, rs);
      else enforce(false);
      enforce(ls==rs);
      auto m=(r+l)/2;
      q(m); auto ms=read();
      if(ms==-1) return;
      if(ls==ms) fun(l, ls, m, ms);
      else if(ms!=ls) fun(m, ms, r, rs);
    }
  }
  fun(l, ls, r, rs);
}

void rd(T...)(ref T x){
  import std.stdio, std.string, std.conv;
  auto l=readln.split;
  assert(l.length==x.length);
  foreach(i, ref e; x){
    e=l[i].to!(typeof(e));
  }
}