count = [Hash.new(0), Hash.new(0)]

while gets
    $_.split.map(&:to_f).each.with_index do |e, i|
        g = case e
            when 0 ... 0.2;   ?D
            when 0.2 ... 0.6; ?C
            when 0.6 ... 1.1; ?B
            else;             ?A
        end
        count[i][g] += 1
    end
end

%w(A B C D).each do |g|
    puts [count[0][g], count[1][g]] * ' '
end