import Control.Monad
import Control.Monad.ST
import qualified Data.Array as A
import qualified Data.Array.ST as ST
import qualified Data.Array.Unboxed as AU
import qualified Data.ByteString.Char8 as BS
import Data.Char
import Data.Int
import qualified Data.IntMap as IM
import Data.List
import qualified Data.Map as M
import Data.Maybe
import Data.Ord
import qualified Data.Set as S
import Data.Time
import qualified Data.Vector as V
import qualified Data.Vector.Mutable as VM
import qualified Data.Vector.Unboxed as VU
import qualified Data.Vector.Unboxed.Mutable as VUM
import System.Exit
import System.IO

readInt :: IO [Int]
readInt = map (fst . fromJust . BS.readInt) . BS.words <$> BS.getLine

readInts :: Int -> IO [[Int]]
readInts n = replicateM n readInt

readString :: IO [String]
readString = map BS.unpack . BS.words <$> BS.getLine

readStrings :: Int -> IO [[String]]
readStrings n = replicateM n <$> readString

toPair :: [a] -> (a, a)
toPair [x, y] = (x, y)

main = do
  [n] <- readInt
  hSetBuffering stdout NoBuffering
  print 0
  a <- getLine
  when (a == "Vacant") exitSuccess
  print (n - 1)
  b <- getLine
  when (b == "Vacant") exitSuccess
  f 0 a (n - 1) b

f :: Int -> String -> Int -> String -> IO ()
f l l' r r' = do
  let n = m (l + r)
  print n
  a <- getLine
  if a == "Vacant"
    then exitSuccess
    else if even (n - l) && l' /= a
           then f l l' n a
           else f n a r r'

m :: Int -> Int
m a
  | a `mod` 2 == 0 = a `div` 2
  | otherwise = a `div` 2 + 1