h = Array.new(5) { Array.new(3) { Array.new(10,0) } }
n = gets.to_i
n.times do
  a,b,c,d = gets.split.map(&:to_i)
  h[a-1][b-1][c-1] += d
end

for i in 0..4  do
  for j in 0..3 do
        print h[i][j]
        print " "
        print "\n"
  end
  puts "#"*20
end
