class Mode
  def initialize
    @numbers = Hash.new
    @result = []
    while num = $stdin.gets do
      num = num.chomp.to_i
      if @numbers.has_key?(num)
        @numbers[num] += 1
      else
        @numbers[num] = 1
      end
    end
    
    max = 0

    @numbers.each_pair do |num, count|
      if max < count 
        max = count
        @result = [num]
      elsif max == count
        @result << num
      end
    end

    @result.sort.each do |n|
      puts n
    end
  end
end

m = Mode.new