import scala.io.StdIn._

object Main extends App {


  val n = readInt()
  val S = Array.fill(n)(readLine())

  def solve() = {
    val strAndCntSeq = S.groupBy(identity).mapValues(_.length).toSeq.sortBy(- _._2)
    val maxCnt = strAndCntSeq.head._2
    strAndCntSeq.foldLeft(Seq.empty[String]) { case (acc, (str, cnt)) =>
      if(cnt == maxCnt) str +: acc else acc
    }.sorted.mkString("\n")
  }

  println(solve())

}

