import kotlin.comparisons.compareBy
fun main(args: Array<String>) {
    val N = nextInt()
    val S = Array(N) { next() }
    val M = S.groupBy { it }.map { it.key to it.value.size }.sortedWith(compareBy({ -it.second }, { it.first }))
    val max = M.first().second
    //M.filter { it.second == max }.forEach { println(it.first) }
    println(M.filter { it.second == max }.map { it.first }.joinToString(separator = "\n"))
}
fun next() = readLine()!!
fun nextInt() = Integer.parseInt(next())
