a = Array.new(7, 0) gets gets.split.map(&:to_i).each do |l| a[l] += 1 end puts a.rindex(a.max)