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

  int n; rd(n);

  writeln(0); stdout.flush();
  auto s1=readln.chomp.to!(char[]);
  if(s1=="Vacant") return;
  auto k=n/2; if(k&1) k++;
  writeln(k); stdout.flush();
  auto s2=readln.chomp.to!(char[]);
  if(s2=="Vacant") return;

  if(n==3){
    writeln(1); stdout.flush();
    auto s3=readln.chomp.to!(char[]);
    enforce(s3=="Vacant");
    return;
  }

  const M=0, F=1;
  int enc(char[] str){
    if(str[0]=='M') return M;
    else if(str[0]=='F') return F;
    else return -1;
  }
  int g(char c){
    if(c=='M') return M;
    else if(c=='F') return F;
    else if(c=='V') return -1;
    else{
      enforce(false); return -10000;
    }
  }
  bool fin=false;
  void fun(int l, int ls, int r, int rs){ // [l, r] se(l-1)=ls, se(r+1)=rs
    // writeln(l, " ", ls, " ", r, " ", rs);
    if(fin) return;
    enforce(l<=r);
    if(l==r){
      writeln(l); stdout.flush();
      auto t=readln.chomp.to!(char[]);
      enforce(t[0]=='V');
      fin=true; return;
    }else if(r-l==1){
      writeln(l); stdout.flush();
      auto t1=readln.chomp.to!(char[]);
      if(t1[0]=='V'){fin=true; return;}
      writeln(r); stdout.flush();
      auto t2=readln.chomp.to!(char[]);    
      enforce(t2[0]=='V');
      fin=true; return;
    }else if((r-l+1)&1){ // 奇数
      auto m=(r+l)/2;
      writeln(m); stdout.flush();
      auto t=readln.chomp.to!(char[]),
           ms=g(t[0]);
      if(ms==-1){fin=true; return;}
      if(ms==ls) fun(m+1, ms, r, rs);
      else if(ms==rs) fun(l, ls, m-1, ms);
      else enforce(false);
    }else{
      enforce(ls==rs);
      auto m=(r+l+1)/2;
      writeln(m); stdout.flush();
      auto t=readln.chomp.to!(char[]),
           ms=g(t[0]);
      if(ms==-1){fin=true; return;}
      if(ms==ls) fun(l, ls, m-1, ms);
      else fun(m+1, ms, r, rs);
    }
  }

  
  auto v1=enc(s1), v2=enc(s2);
  if(v1==v2){
    fun(k+1, v1, n-1, v2);
  }else{
    fun(1, v1, k-1, v2);
  }
}

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));
  }
}
void wr(T...)(T x){
  import std.stdio;
  foreach(e; x) write(e, " ");
  writeln();
}