import java.util.HashMap
import java.util.ArrayList

fun main(args: Array<String>) {
    val (N) = readLine()!!.split(" "). map { it.toInt() }
    val map = HashMap<String, Int>(100000)
    var max = 0
    for (i in 0 until N) {
        val s = readLine()!!
        var count = map[s] ?: 0
        count++
        map[s] = count
        max = Math.max(max, count)
    }
    val list : MutableList<String> = ArrayList(100000)
    map.filter {
        it.value == max
    }.forEach {
        list.add(it.key)
    }
    list.sortedBy { it }.forEach { println(it) }
}