nums = Array.new
nums << $_.to_i while gets
nums.sort!
num_max = 0
results = Array.new
while true
  target = nums.select {|x| x == nums[0]}
  temp_max = target.size
  if num_max < temp_max
    results.clear
    results << target.first
    num_max, temp_max = temp_max, 0
  elsif temp_max == num_max
    results << target.first
  end
  nums = nums.slice!(target.size,(nums.size-target.size))
  break if nums.size == 0
end

0.upto(results.size-1) {|p| puts results[p]}