import kotlin.collections.ArrayDeque

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

    println(0)
    var lowerS = readLine()!!
    if (lowerS == Pos.VACANT) return

    println(n-1)
    var upperS = readLine()!!
    if (upperS == Pos.VACANT) return

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

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

        println(pos.idx)
        val res = readLine()!!
        if (res == Pos.VACANT) return

        val lowerCnt = pos.idx - pos.lower - 1
        val upperCnt = pos.upper - pos.idx - 1
        if ((lowerCnt % 2 == 1 && lowerS != res) || (lowerCnt > 0 && lowerCnt % 2 == 0 && lowerS == res)) {
            // a vacant seat in lower bound
            val nextIdx = pos.lower + (lowerCnt+1)/2
            bfs.addLast(Pos(nextIdx, pos.lower, pos.idx))
        } else {
            // a vacant seat in upper bound
            lowerS = res
            val nextIdx = pos.idx + (upperCnt+1)/2
            bfs.addLast(Pos(nextIdx, pos.idx, pos.upper))
        }
    }
}

data class Pos(val idx: Int, val lower: Int, val upper: Int) {
    companion object {
        val VACANT = "Vacant"
        val MALE = "Male"
        val FEMALE = "Female"
    }
}