import java.util.*
import kotlin.comparisons.compareByDescending
import kotlin.comparisons.thenBy

fun main(args: Array<String>) {
    val n = readLine()!!.toInt()
    val count = HashMap<String, Int>()
    repeat(n) {
        val s = readLine()!!
        val c = count.getOrPut(s, { 0 }) + 1
        count[s] = c
    }
    val ans = count.toList().sortedWith(compareByDescending<Pair<String, Int>> { it.second }.thenBy { it.first })
    for (x in ans) {
        if (x.second != ans[0].second) {
            break
        }
        println(x.first)
    }
}
