fun main(args: Array<String>) {
    val pw = java.io.PrintWriter(System.out)
    Problem.solve(java.util.Scanner(System.`in`), pw)
    pw.flush()
}

object Problem {
    fun solve(sc: java.util.Scanner, pw: java.io.PrintWriter) {
        val N = sc.next().toInt()
        val c = mutableMapOf<String, Int>()
        var max = 0
        for (i in 0 until N) {
            val s = sc.next()
            c[s] = (c[s] ?: 0) + 1
            if (c[s]!! > max) {
                max = c[s]!!
            }
        }
        val ans = mutableListOf<String>()
        c.forEach {
            if (it.value == max) ans += it.key
        }
        ans.sorted().forEach { pw.println(it) }
    }
}
