object Main extends App {
  val in = new java.util.Scanner(System.in)
  val N = in.nextInt
  val Ss = Array.fill(N)(in.next)
  val targets = Ss.groupBy(identity).mapValues(_.size)
  val max = targets.maxBy(_._2)._2
  println(targets.filter(_._2 == max).map(_._1).toList.sorted.mkString("\n"))
}