fun main(args: Array<String>) {
    val N = readLine()!!.toInt()
    val dict = mutableMapOf<String, Int>()
    repeat(N) {i ->
        val S = readLine()!!
        val v = dict[S] ?: 0
        dict[S] = v + 1
    }
    val max = dict.values.max()
    val ans = dict.filterValues { v -> v == max }.keys.sorted()
    println(ans.joinToString("\n"))
}