import Foundation
 
let N = Int(readLine()!)!
var array = [String]()
var dictionary = [String: Int]()
var max = 0
for i in 0..<N {
  var key = readLine()!
  let value = dictionary[key] ?? 0
  dictionary[key] = value + 1
  if max < value + 1 {
    max = value + 1
  }
}
let answer = dictionary.filter { $0.1 == max }
answer.map { print($0.0) }