object Main extends App {
	val N = scala.io.StdIn.readInt
	var map = Map[String, Int]()

	for(i<-0 until N){
		val s = scala.io.StdIn.readLine
		map += s->(1 + map.getOrElse(s, 0))
	}

	val vmax = map.maxBy(_._2)
	map.filter(_._2 == vmax._2).keys.toList.sorted.foreach(println(_))
}