object Main extends App {
  val n = scala.io.StdIn.readInt()
  var sArray = Seq.empty[String]
  (1 to n).foreach(_ =>
    sArray :+= scala.io.StdIn.readLine()
  )
  var resultSeq = Seq.empty[String]
  var tempWord = ""
  var tempCount = 0
  var maxCount = 0
  sArray.sorted.zipWithIndex.foreach { s =>
    if(tempWord == "" || s._1 == tempWord) {
      tempCount = tempCount + 1
      tempWord = s._1
    } else {
      if (maxCount < tempCount) {
        maxCount = tempCount
        resultSeq = Seq(tempWord)
      } else if (maxCount == tempCount) {
        resultSeq = resultSeq :+ tempWord
      }
      tempWord = s._1
      tempCount = 1
    }
    if (s._2 == n - 1) {
      if (maxCount < tempCount) {
        maxCount = tempCount
        resultSeq = Seq(tempWord)
      } else if (maxCount == tempCount) {
        resultSeq = resultSeq :+ tempWord
      }
    }
  }
  resultSeq.foreach { r =>
    println(r)
  }
}