import Control.Applicative
import Data.Bits

main :: IO()
main = do
    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
                case s of
                    "Vacant" -> return ()
                    _ -> if xor same isOdd then myAns l m sl s else myAns m r s sr
                    where
                        m = (l+r) `div` 2
                        same = sl == sr
                        isOdd = odd (l-m)
