import scala.io.StdIn._
object Main extends App {
  val n = readInt
  var map = Map[String, Int]()

  for (_ <- 1 to n) {
    val s = readLine
    map.get(s) match {
      case Some(i) => map = map + (s -> (i + 1))
      case None    => map = map + (s -> 1)
    }
  }
  val max = map.maxBy(_._2)._2
  map.filter(_._2 == max).toList.sortBy(_._1).foreach(s => println(s._1))
}
