import java.lang.StringBuilder

fun main(arr:Array<String>) {
    val itemCount = readLine()!!.toInt()
    val cnt = mutableMapOf<String,Int>()
    var maxCount = 0
    for(i in (0 until itemCount)) {
        val s = readLine()!!
        if(cnt.containsKey(s)) {
            cnt[s] = cnt[s]!! + 1
        } else {
            cnt[s] = 1
        }
        maxCount = Math.max(maxCount, cnt[s]!!)
    }
    val ans = StringBuilder()
    cnt.filter { it.value == maxCount }.keys.sorted().forEach { ans.appendln(it) }
    print(ans.toString())

}
