import java.io.PrintWriter
import scala.io.StdIn._
object Main extends App {
  val n = readInt
  var map = Map[String, Int]()

  for (_ <- 1 to n) {
    val s = readLine
    map.get(s) match {
      case Some(i) => map = map + (s -> (i + 1))
      case None    => map = map + (s -> 1)
    }
  }
  val m = map.toSeq.sortWith(_._2 > _._2)
  val max = m.head._2

  val pw = new PrintWriter(System.out)
  m.collect { case v if v._2 == max => v._1 }.sorted.foreach(pw.println(_))
  pw.flush()
}
