import scala.util.Random

object Main extends App {
  import scala.io.StdIn._

  val n = readInt
  val rule = Array.tabulate(n){_ ⇒ readLine.trim}
  if (rule.exists(!_.contains('x'))) {
    val hand = rule.indices.find(!rule(_).contains('x')).get
    for (_ ← 0 until 1000){
      println(hand + 1)
      readInt
    }
  }else {
    val scores = rule.map(_.count(_ == 'o'))
    for (i ← rule.indices.tail) scores(i) += scores(i - 1)
    val sum = scores.last
    val random = new Random()
    for (_ ← 0 until 1000) {
      val next = lowerBound(scores, random.nextInt(sum))
      println(next + 1)
      readInt
    }
  }
  def lowerBound(array: Array[Int], target: Int): Int = {
    var left = 0
    var right = array.length - 1
    while (left < right){
      val mid = (left + right) / 2
      if (array(mid) < target){
        left = mid + 1
      }else {
        right = mid
      }
    }
    right
  }
  implicit class Scope[T](val value: T) extends AnyVal {
    @inline def also(@inline func: T ⇒ Unit): T = {
      func(value)
      value
    }
    @inline def let[A](@inline func: T ⇒ A): A = func(value)
  }
}
