fun main(args : Array<String>) {
    val n = readLine()!!.toInt()
    val ss = mutableMapOf<String, Int>()

    var max = 0
    repeat(n) {
        val s = readLine()!!
        val i = (ss[s] ?: 0) + 1
        ss[s] = i

        if (i > max) {
            max = i
        }
    }

    ss.entries.filter { it.value == max }.sortedBy { it.key }.forEach {
        println(it.key)
    }
}