


import scala.annotation.tailrec
import scala.collection.mutable
import scala.io.StdIn._
object Main extends App {
  val n = readInt()
  val words = Array.fill(n){readLine.trim}
  val g = words.groupBy(i ⇒ i).mapValues(_.size)
  val max = g.maxBy(_._2)._2
  println(
    g.filter(_._2 == max).toArray.map(_._1).sorted.mkString("\n")
  )
}
