# coding: utf-8

data = {}
while i = gets do
  i = i.chomp
  next if i.empty?
  cnt = data[i]
  cnt = 0 if cnt == nil
  data[i] = cnt += 1
end

result = data.sort {|(k1, v1), (k2, v2)| v2 <=> v1}

max = 0
array = []
result.each do |key, value|
  if max.to_i > value.to_i then
    break
  else
    max = value
  end
  array << key.to_i
end

array.sort!{|a, b| (a <=> b)}
array.each do |a|
  puts a
end