n = gets.chomp.to_i
house = Array.new(4).map{ Array.new(3).map{ Array.new(10,0)} }

n.times do
    b,f,r,v = gets.chomp.split(" ").map{|item| item.to_i}
    house[b-1][f-1][r-1]+=v
end

4.times do |b|
    3.times do |f|
        10.times do |r|
            print(" ",house[b][f][r])
        end
        puts
    end
    print("#"*20+"\n")
end
puts