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]]
]

loopnum = gets.to_i
(1..loopnum).each do |num|
    input = gets.split(" ").map do |i| i.to_i end
    house[input[0]-1][input[1]-1][input[2]-1] += input[3]
end

(0..2).each do |i|
    puts house[0][i].join(" ")
end
puts "####################"
(0..2).each do |i|
    puts house[1][i].join(" ")
end
puts "####################"
(0..2).each do |i|
    puts house[2][i].join(" ")
end
puts "####################"
(0..2).each do |i|
    puts house[3][i].join(" ")
end