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

		if(map.contains(s)){
			map += s->(map(s) + 1)
		}else{
			map += s->1
		}
	}

	val tp = map.toArray.sortBy(_._2).reverse.toList
	var list = List[(String, Int)]()

	val maxP = tp.head._2
	for(x<-tp){
		if(maxP == x._2) list ::= x
	}

	list.map{case (z, y) => z}.sorted.foreach(println(_))
}