arr = gets.chomp.split.map(&:to_i)
result = [0, 0, 0, 0, 0]
prev = arr[1]
pd1 = pd2 = nil
arr[2..-1].each{|x|
    d = (x == prev) ? 0 : (x > prev) ? 1 : -1
    prev = x
    
    if d != pd1
        case pd1
        when 0
            case d
            when +1
                case pd2
                when +1 then result[2] += 1
                when -1 then result[1] += 1
                end
            when -1
                case pd2
                when -1 then result[2] += 1
                when +1 then result[0] += 1
                end
            end
        when +1, -1
            case d
            when +1 then result[4] += 1
            when -1 then result[3] += 1
            end
        end
        pd2 = pd1
        pd1 = d
    end
}
puts result.join(" ")
