object Main extends App {
	val scanner = new java.util.Scanner(System.in)
	val N = scanner.nextInt()
		
	val s = Array.fill(N)(scanner.next)

	val map = scala.collection.mutable.HashMap[String, Int]()

	for(i<-0 until N){
		val tp = s(i)
		map.put(tp, 1 + map.getOrElse(tp, 0))
	}

	val vmax = map.values.max
	val tmp = map.filter(z => z._2 == vmax).keys.toArray.sorted

	tmp.foreach(println(_))
}