class ModeValue
  def mode(array)
    result = array.each_with_object(Hash.new(0)) { |i, h| h[i] += 1 }
    max = result.values.max
    result.select { |_, v| v == max }.keys.sort
  end
end

array = STDIN.read.split("\n").map(&:to_i)
puts ModeValue.new.mode(array)