fun main(args: Array<String>) {
    val n = readLine()!!.toInt()
    val sList = (1..n).map { readLine()!! }.sorted()
    val map = mutableMapOf<String, Int>()
    sList.forEach { map[it] = map.getOrDefault(it, 0) + 1 }
    val list = map.map { Pair(it.key, it.value) }.sortedBy { it.first }.sortedByDescending { it.second }

    val maxNum = list[0].second
    for (l in list) {
        if (maxNum == l.second) {
            println(l.first)
        } else {
            return
        }
    }
}