$array=Array.new(4).map{Array.new(3).map{Array.new(10,0)}}
N=gets.to_i
for i in 1..N do
 b,f,r,v=gets.chomp.split(" ").map(&:to_i)
 $array[b-1][f-1][r-1]=$array[b-1][f-1][r-1]+v
end
for i1 in 0..3 do
 for i2 in 0..2 do
 for i3 in 0..9 do
  print(" #{$array[i1][i2][i3]}")
 end
  print "\n"
 end
if(i1==3)
 break
end
print("####################\n")
end
