fun main(args: Array<String>) {
    apc001c()
}

private enum class Seat(private val value: String) {
    VACANT("Vacant"), MALE("Male"), FEMALE("Female");

    override fun toString(): String {
        return this.value
    }
}

private fun query(i: Int): Seat {
    println(i)
    return Seat.valueOf(readLine()!!.toUpperCase())
}

fun apc001c() {
    val n = readLine()!!.toInt()

    var leftIndex = 0
    var left = query(leftIndex)
    if (left == Seat.VACANT) return

    var rightIndex = n - 1
    val right = query(rightIndex)
    if (right == Seat.VACANT) return

    while (true) {
        val midIndex = (leftIndex + rightIndex) / 2
        val mid = query(midIndex)
        when (mid) {
            Seat.VACANT -> return
            else -> {
                val indexDiff = midIndex - leftIndex
                if ((mid != left && indexDiff % 2 == 0) || (mid==left && indexDiff%2==1)) {
                    rightIndex = midIndex
                } else {
                    leftIndex = midIndex
                    left = mid
                }
            }
        }
    }
}
