n = gets.to_i

dwellers = Array.new(4).map{Array.new(3).map{Array.new(10, 0)}}

while input = gets
    b, f, r, v = input.chomp.split(" ").map(&:to_i)
    
    dwellers[b - 1][f - 1][r - 1] += v
end

for i in 0..3
    for j in 0..2
        for k in 0..9
            print " #{dwellers[i][j][k]}"
        end
        puts ""
    end
    if i != 3
        puts "####################"
    end
end
