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[0]=='V') return;
  auto k=n/2; if(k&1) k++;
  writeln(k); stdout.flush();
  auto s2=readln.chomp.to!(char[]);
  if(s2[0]=='V') return;

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

  const M=0, F=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;
    }
  }
  
  auto v1=g(s1[0]), v2=g(s2[0]);
  int l, ls, r, rs;
  if(v1==v2){l=k+1; ls=v1; r=n-1; rs=v2;}
  else{l=1; ls=v1; r=k-1; rs=v2;}
  
  for(int itr=2; ;){
    if(l==r){
      enforce(0<=l && l<n);
      enforce(++itr<=20);
      writeln(l); stdout.flush();
      auto t=readln.chomp.to!(char[]);
      enforce(t[0]=='V'); break;
    }else if(r-l==1){
      enforce(0<=l && l<n);
      enforce(++itr<=20);
      writeln(l); stdout.flush();
      auto t1=readln.chomp.to!(char[]);
      if(t1[0]=='V') break;
      enforce(0<=r && r<n);
      enforce(++itr<=20);
      writeln(r); stdout.flush();
      auto t2=readln.chomp.to!(char[]);    
      enforce(t2[0]=='V'); break;
    }else if((r-l+1)&1){
      auto m=(r+l)/2;
      enforce(0<=m && m<n);
      enforce(++itr<=20);
      writeln(m); stdout.flush();
      auto t=readln.chomp.to!(char[]),
           ms=g(t[0]);
      if(ms==-1) break;
      if(ms==ls){l=m+1; ls=ms;}
      else if(ms==rs){r=m-1; rs=ms;}
      else enforce(false);
    }else{
      enforce(ls==rs);
      auto m=(r+l+1)/2;
      enforce(0<=m && m<n);
      enforce(++itr<=20);
      writeln(m); stdout.flush();
      auto t=readln.chomp.to!(char[]),
           ms=g(t[0]);
      if(ms==-1) break;
      if(ms==ls){r=m-1; rs=ms;}
      else if(ms==(1-ls)){l=m+1; ls=ms;}
      else enforce(false);
    }
  }
}

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));
  }
}