import java.util.*

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