fun main(args: Array<String>) = println(run {
    val n = readLine()!!.toInt()
    val s = (1..n).map { readLine()!! }

    val vote = s.groupBy { it }.mapValues { it.value.size }
    val max = vote.map { it.value }.max()!!
    vote.filter { it.value == max }.map { it.key }.sorted().joinToString("\n")
})