object Main extends App{
  import scala.io.StdIn._
  val n=readInt()
  var map=scala.collection.mutable.Map[String,Int]()
  for {i <- (0 until(n))}{
    val s=readLine()
    map(s) = if(map.contains(s)) map(s) + 1 else 1
  }
  val m=map.toSeq.sortWith(_._2>_._2)
  val top=m.head._2
  m.collect{case r if r._2 == top => r._1}.sorted.foreach(println(_))
}