nums = Array.new
nums << $_.to_i while gets
nums.sort!
num_max = 1
temp_max = 1
results = Array.new
1.upto(nums.size-1) do |i|
  if nums[i] == nums[i-1]
    temp_max += 1
  elsif num_max < temp_max
    results.clear
    results << nums[i-1]
    num_max = temp_max
    temp_max = 1
  elsif num_max == temp_max
    results << nums[i-1]
    temp_max = 1
  end
end
0.upto(results.size-1) {|p| puts results[p]}