counts={}
while a = STDIN.gets
  a = a.chomp.to_i
  if counts.has_key?(a) then
    counts[a]+=1
  else
    counts[a]=1
  end
end

largest_frequency = counts.values.max_by { |item| item }

modes=[]

counts.keys.each do |k|
  if counts[k] == largest_frequency then
    modes.push(k)
  end
end

modes.sort.each do |a|
  puts a
end