import Foundation
 
let N = Int(readLine()!)!
var array = [String]()
var dictionary = [String: Int]()
for i in 0..<N {
  var key = readLine()!
  if dictionary[key] == nil {
    dictionary[key] = 1
  } else {
    dictionary[key] = dictionary[key]! + 1
  }
}
let tupleArray = dictionary.sort { $0.1 > $1.1 }
var answer = [String]()
for i in 0..<tupleArray.count {
  if tupleArray[i].1 == tupleArray[0].1 {
    answer.append(tupleArray[i].0)
  } else {
    break
  }
}
answer = answer.sort { $0 < $1 }
answer.map { print($0) }