ans = Array.new(4, 0)
gets(p).split("\n").map do |line|
    ta, tb, tc = line.split.map(&:to_i)
    c = [ta, tb, tc].max
    a = [ta, tb, tc].min
    b = ta + tb+ tc - a - c
    if a + b > c and b + c > a and c + a > b then
        ans[0] += 1
        if a ** 2 + b ** 2 == c ** 2 then
            ans[1] += 1
        elsif a ** 2 + b ** 2 > c ** 2 then
            ans[2] += 1
        elsif a ** 2 + b ** 2 < c ** 2 then
            ans[3] += 1
        end
    else
        puts "%d %d %d %d" % ans
        exit
    end
end

puts "%d %d %d %d" % ans
