import java.io.BufferedReader
import java.io.InputStream
import java.io.InputStreamReader
import java.util.*

fun main(args: Array<String>) {
    val n = readLine()!!.toInt()
    val map = mutableMapOf<String, Int>()
    for (i in 0 until n) {
        val s = readLine()!!
        if (!map.containsKey(s)) {
            map[s] = 0
        }
        map[s] = map[s]!! + 1
    }
    val max = map.values.max()!!
    val lst = map.keys.filter { map[it] == max }.toMutableList()
    lst.sort()
    for (s in lst) {
        println(s)
    }
}