gets
ary = [[], [], [], []]

(0..3).each do |i|
  3.times{|a| ary[i] << [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]}
end
ARGF.each_line do |line|
  b, f, r, v = line.chomp.split.map(&:to_i)
  ary[b-1][f-1][r-1] += v
end
4.times do |n|
  puts "#"*20 unless n == 0
  3.times{|i| puts "\s" + ary[n][i].join("\s")}
end