import Foundation

let n = Int(readLine()!)!

var dic: [String] = []
for i in 0 ..< n {
    dic.append(readLine()!)
}

var w: [String: Int] = [:]

for i in 0 ..< n {
    if w[dic[i]] == nil {
        w[dic[i]] = 1
    } else {
        w[dic[i]]! += 1
    }
}

let sorted = w.sorted(by: <).sorted(){ $0.1 > $1.1 }
let max = sorted.first!.value
sorted.forEach {
    if $0.1 < max {
        return
    }
    print($0.0)
}