import java.util.*

fun main(args: Array<String>) {
    val sc = Scanner(System.`in`)
    val n = sc.nextInt()
    val s = (0 until n).map { 
        sc.next().toString()
     }

    val map = HashMap<String, Int>()
    for (si in s) {
        if (map.containsKey(si)) {
            map[si] = map[si]!! + 1
        } else {
            map[si] = 1
        }
    }

    val max = map.values.max()!!
    
    var ans = map.filter { it.value == max }.map { it.key }.sorted().joinToString("\n")
    println(ans)
}
