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==V) return;
      if(ls==ms){
        if((m-l+1)&1) fun(m, ms, r, rs); 
        else fun(l, ls, m, ms);
      }else{
        if((m-l+1)&1) fun(l, ls, m, ms);
        else fun(m, ms, r, rs);
      }
    }else{
      enforce(ls==rs);
      auto m=(r+l)/2;
      q(m); auto ms=read();
      if(ms==V) return;
      if(ls==ms){
        if((m-l+1)&1) fun(m, ms, r, rs);
        else fun(l, ls, m, ms);
      }else{
        if((m-l+1)&1) fun(l, ls, m, ms);
        else 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));
  }
}