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