query i f = do
  print i
  s <- getLine
  case s of
    "Vacant" -> return ()
    _ -> f s

test l r s t
  | odd (l-r) = s /= t
  | otherwise = s == t

loop l r s = do
  query m $ \t -> do
  if test l (m-1) s t then
    loop l (m-1) s
  else
    loop (m+1) r t
  where m = l+r`div`2

main = do
  n <- readLn
  query 0 $ \s -> do
  query (n-1) $ \_ -> do
  loop 0 (n-1) s