object Main extends App {
  val sc = new java.util.Scanner(System.in)
  val N = sc.nextInt()
  val treeMap = new scala.collection.mutable.TreeMap[String, Int]()
  1.to(N).foreach { _ =>
    val x = sc.next()
    val count = treeMap.getOrElseUpdate(x, 0)
    treeMap.update(x, count + 1)
  }
  val max = treeMap.values.max
  treeMap.filter { case (_, count) => count == max }.keys.foreach(println)
}
