import java.util.*
fun main(args: Array<String>) {
  val n = readLine()!!.toString().toInt()
  val map = hashMapOf<String, Int>()
  repeat(n) {
    val s = readLine()!!
    map[s] = (map[s]?:0)+1
  }
  
  val max = map.values.max()
  println(map.entries.filter { it.value == max }.map { it.key }.sorted().joinToString("\n"))
}