import java.util.*

fun main(args : Array<String>) {
    val n = readLine()!!.toInt()
    val s = HashMap<String, Int>(n)
    var maxc = 1
    (1..n).forEach {
        val si = readLine()!!
        val cnt = s[si]
        if (cnt == null) {
            s[si] = 1
        } else {
            s[si] = cnt + 1
            maxc = Math.max(maxc, cnt + 1)
        }
    }
    val ans = TreeSet<String>()
    for ((k, v) in s) {
        if (v == maxc) ans += k
    }
    ans.forEach(::println)
}
