import scala.io.StdIn._
object Main extends App {
  val k = readInt()
  val isono = Array.tabulate(k){_ ⇒ readLine.trim}
  val nakajima = Array.tabulate(k){_ ⇒ readLine.trim}
  println(
    isono.zip(nakajima).foldLeft(new Continue: State){
      case (c, (i, n)) ⇒ c.next(Pose.parse(i), Pose.parse(n))
    } match {
      case Continue(_, _) ⇒ "Hikiwake-kun"
      case WonBy(Isono) ⇒ "Isono-kun"
      case WonBy(Nakajima) ⇒ "Nakajima-kun"
    }
  )
}

sealed trait State {
  def next(isonos: Pose, nakajimas: Pose): State = this
}
case class Continue private (isono: Int, nakajima: Int) extends State {
  def this(){this(0, 0)}

  override def next(isonos: Pose, nakajimas: Pose): State = {
    (isonos, nakajimas) match {
      case (Attack, Attack) if isono == nakajima ⇒ new Continue()
      case (Attack, Attack) ⇒ WonBy(if (isono > nakajima) Isono else Nakajima)
      case (Attack, _) if isono == 0 ⇒ WonBy(Nakajima)
      case (_, Attack) if nakajima == 0 ⇒ WonBy(Isono)
      case (Attack, Defence) ⇒ if (isono == 5) WonBy(Isono) else new Continue(0, nakajima)
      case (Defence, Attack) ⇒ if (nakajima == 5) WonBy(Nakajima) else new Continue(isono, 0)
      case (Attack, Charge) ⇒ WonBy(Isono)
      case (Charge, Attack) ⇒ WonBy(Nakajima)
      case _ ⇒ new Continue(if (isonos == Charge && isono < 5) isono + 1 else isono, if (nakajimas == Charge && nakajima < 5) nakajima + 1 else nakajima)
    }
  }
}
case class WonBy(player: Player) extends State

sealed trait Player
object Isono extends Player
object Nakajima extends Player
sealed trait Pose
object Pose{
  def parse(arg: String): Pose = {
    arg match {
      case Attack() ⇒ Attack
      case Defence() ⇒ Defence
      case Charge() ⇒ Charge
      case _ ⇒ ???
    }
  }
}
object Attack extends Pose {
  def unapply(arg: String): Boolean = arg == "kougekida"
}
object Defence extends Pose {
  def unapply(arg: String): Boolean = arg == "mamoru"
}
object Charge extends Pose {
  def unapply(arg: String): Boolean = arg == "tameru"
}
