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