import kotlin.collections.ArrayDeque

@kotlin.ExperimentalStdlibApi
fun main(args : Array<String>) {
    val n = readLine()!!.toInt()
    val result = Array(n) {""}

    println(0)
    result[0] = readLine()!!
    if (result[0] == "Vacant") return

    println(n-1)
    result[n-1] = readLine()!!
    if (result[n-1] == "Vacant") return

    val bfs = ArrayDeque<Pos>()
    bfs.addLast(Pos(n/2, 0, n-1))

    while (bfs.isNotEmpty()) {
        val pos = bfs.removeFirst()

        println(pos.idx)
        result[pos.idx] = readLine()!!
        if (result[pos.idx] == "Vacant") return

        val lowerCnt = pos.idx - pos.lower - 1
        val upperCnt = pos.upper - pos.idx - 1

        if (lowerCnt % 2 == 1 && result[pos.idx] != result[pos.lower]) {
            val lowerIdx = (lowerCnt+1) / 2
            bfs.addLast(Pos(pos.lower+lowerIdx, pos.lower, pos.idx))
        } else if (lowerCnt > 0 && lowerCnt % 2 == 0 && result[pos.idx] == result[pos.lower]) {
            val lowerIdx = lowerCnt / 2
            bfs.addLast(Pos(pos.lower+lowerIdx, pos.lower, pos.idx))
        } else if (upperCnt % 2 == 1 && result[pos.idx] != result[pos.upper]) {
            val upperIdx = (upperCnt+1) / 2
            bfs.addLast(Pos(pos.idx+upperIdx, pos.idx, pos.upper))
        } else if (upperCnt > 0 && upperCnt % 2 == 0 && result[pos.idx] == result[pos.upper]) {
            val upperIdx = upperCnt / 2
            bfs.addLast(Pos(pos.idx+upperIdx, pos.idx, pos.upper))
        } else {
            // looks ok -> add both upper/lower bounds
            if (lowerCnt > 0) {
                val lowerIdx = (lowerCnt+1) / 2
                bfs.addLast(Pos(pos.lower+lowerIdx, pos.lower, pos.idx))
            }
            if (upperCnt > 0) {
                val upperIdx = (upperCnt+1) / 2
                bfs.addLast(Pos(pos.idx+upperIdx, pos.idx, pos.upper))
            }
        }
    }
}

data class Pos(val idx: Int, val lower: Int, val upper: Int)