official_house = [
                    [
                        [0,0,0,0,0,0,0,0,0,0,],
                        [0,0,0,0,0,0,0,0,0,0,],
                        [0,0,0,0,0,0,0,0,0,0,]
                    ],
                    [
                        [0,0,0,0,0,0,0,0,0,0,],
                        [0,0,0,0,0,0,0,0,0,0,],
                        [0,0,0,0,0,0,0,0,0,0,]
                    ],
                    [
                        [0,0,0,0,0,0,0,0,0,0,],
                        [0,0,0,0,0,0,0,0,0,0,],
                        [0,0,0,0,0,0,0,0,0,0,]
                    ],
                    [
                        [0,0,0,0,0,0,0,0,0,0,],
                        [0,0,0,0,0,0,0,0,0,0,],
                        [0,0,0,0,0,0,0,0,0,0,]
                    ]
                ]

n = gets.to_i
n.times do
    b, f, r, v = gets.split().map(&:to_i)
    official_house[b-1][f-1][r-1] += v
end

4.times do |b|
    puts "#"*20 unless b == 0
    3.times do |f|
        puts " " + official_house[b][f].join(" ")
    end
end