fun main(args: Array<String>) {
    val N = readInputLine().toInt()
    val ss = Array<String>(N) { readInputLine() }
    ss.sort()

    var maxCnt = 1
    var cntTmp = 1

    var ans = mutableListOf<String>()

    for (i in 1 until N) {
        if (ss[i] != ss[i - 1]) {
            if (cntTmp > maxCnt) {
                ans.clear()
                ans.add(ss[i - 1])
                maxCnt = cntTmp
            } else if (cntTmp == maxCnt) {
                ans.add(ss[i - 1])
            }
            cntTmp = 1
        } else {
            cntTmp++
        }
    }

    if (cntTmp > maxCnt) {
        ans.clear()
        ans.add(ss[N - 1])
    } else if (cntTmp == maxCnt) {
        ans.add(ss[N - 1])
    }

    for (s in ans.sorted()) {
        println(s)
    }
}

fun readInputLine(): String {
    return readLine()!!
}
