import java.util.*

data class T(val c: Int, val s: String)

fun main(args: Array<String>) {
    val n = getInt()
    val m = HashMap<String, Int>()
    repeat(n) {
        val s = readLine()!!
        val c = if (m.containsKey(s)) m[s]!! else 0
        m[s] = c + 1
    }

    val a = ArrayList<T>()
    a.addAll(m.map { T(it.value, it.key) })
    a.sortBy { it.c }
    val num = a.last().c

    var i = a.size - 1
    val b = ArrayList<String>()
    while (i >= 0) {
        if (a[i].c == num) b.add(a[i].s)
        else break
        i--
    }
    b.sort()
    b.forEach { println(it) }
}

fun getInt() = readLine()!!.toInt()
fun getInts() = readLine()!!.split(" ").map { it.toInt() }
fun getLong() = readLine()!!.toLong()
fun getLongs() = readLine()!!.split(" ").map { it.toLong() }