fun main(args: Array<String>) {
    var n=readLine()!!.toInt()
    var strings= mutableListOf<String>()
    var max:Int=0
    var tmp=0
    var before=""
    for(i in 0 until n){
        strings.add(readLine()!!.toString())
    }
    strings.sort()
    for(string in strings){
        if(before!=string){
            if(tmp>max){
                max=tmp
            }
            tmp=0
            before=string
        }
        tmp++
    }
    if(tmp>max){
        max=tmp
    }
    tmp=0
    for(string in strings){
        if(before!=string){
            if(tmp==max){
                println(before)
            }
            tmp=0
            before=string
        }
        tmp++
    }
    if(tmp==max){
        println(before)
    }
}