object Main extends App {
	val sc = new java.util.Scanner(System.in)
	val pw = new java.io.PrintWriter(System.out)

	val m = scala.collection.mutable.Map[String, Int]()
	
	(1 to sc.nextInt).foreach { _ =>
		val s = sc.next
		m(s) = if (m.contains(s)) m(s)+1 else 1
	}
	
	val ranking = m.toSeq.sortWith(_._2 > _._2)
	val top = ranking.head._2
	
	ranking.collect{case r if r._2 == top => r._1}.sorted.foreach(pw.println(_))
	pw.flush()
}