program probC
  implicit none
  integer N,i,k,tmp
  integer*8 st_int(1:20),input_i(1:20)
  character*10 s
  
  read(*,*) N

  input_i=0
  input_i(1)=0
  write(*,*) 0
  read(*,*) s

  call string_for_int(1,s,st_int,input_i)

  
  tmp=n+1
  do i=2,20
     input_i(i)=tmp/2
     write(*,*) input_i(i)
     call flush(7)
     
     read(*,*) s

     call string_for_int(i,s,st_int,input_i)

     
     if(st_int(i).ne.st_int(i-1)) then
        tmp=tmp/2
     else
        tmp=tmp+tmp/2
     end if
     
  end do
  
end program probC

subroutine string_for_int(i,s,st_int,input_i)
  implicit none
  integer i
  integer*8 st_int(1:20),input_i(1:20)
  character*10 s

  if(s=='Vacant')then
     write(*,*) input_i(i)
     stop
  else
     if(s=='Male') then
        st_int(i)=1
     else
        st_int(i)=2
     end if
  end if
  
end subroutine string_for_int
