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 i == nums.size-1
    if nums[i] == nums[i-1]
      temp_max += 1
      results << nums[i] if num_max == temp_max
      if num_max < temp_max
        results.clear
        results << nums[i]
      end
    elsif num_max == 1
      results << nums[i]
    end
  else
    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
end


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