arr = []
f_arr = []
(0..3).each do |b|
  (0..2).each do |f|
    f_arr << [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
  end
  arr << f_arr
  f_arr = []
end

gets
ARGF.each_line do |line|
  b, f, r, v = line.chomp.split.map(&:to_i)
  arr[b-1][f-1][r-1] += v
end

(0..3).each do |b|
  puts "#" * 20 unless b == 0
  (0..2).each do |f|
    puts arr[b][f].join("\s")
  end
end