import System.IO
import Control.Applicative
import Data.Bits

main :: IO()
main = do
    hSetBuffering stdout LineBuffering
    n <- readLn
    print 0
    s <- getLine
    if s == "Vacant"
    then return ()
    else myAns 0 n s s
    where
        myAns l r sl sr = do
            print m
            s <- getLine
            let same = sl == s
            if s == "Vacant"
            then return ()
            else if xor same isEven then myAns l m sl s else myAns m r s sr
            where
                m = (l+r) `div` 2
                isEven = even (m-l)
