object Main extends App {
  
  val sc = new java.util.Scanner(System.in)
  val s = Array.fill(sc.nextInt())(sc.next()).sorted
  var map: scala.collection.mutable.Map[String, Int] = scala.collection.mutable.Map()
  var cnt = 0
  for (i <- 0 until s.length) {
    cnt += 1
    if (i == s.length - 1) {
      map += s(i) -> cnt
    } else if (s(i) != s(i+1)) {
      map += s(i) -> cnt
      cnt = 0
    }
  }  
  val max = map.values.max
  val ans = map.filter{case (k, v) => v == max}.map{case (k, v) => k}.toList.sorted
  ans.foreach(println)
}