arr = Array.new(4){ Array.new(3) { Array.new(10, 0) } }
n = gets.to_i
for i in 1..n
   b, f, r, v = gets.split.map{|v|
      v.to_i
   }
   arr[b-1][f-1][r-1] += v
end
for i in 0..3
  for j in 0..2
    for k in 0..9
      print " ",arr[i][j][k]
      end
    print "\n"
  end
  if i != 3
    print "####################", "\n"
  end
end
