ary = Array.new(4){ Array.new(3){ Array.new(10,0) } }
n = gets.chomp.to_i
n.times do
  b,f,r,v = gets.chomp.split.map(&:to_i)
  ary[b - 1][f - 1][r - 1] += v

end

4.times do |i|
  3.times do |j|
    10.times do |k|
      ary[i][j][k] =
      print " " + ary[i][j][k].to_s
    end
    puts
  end
  puts "#" * 20 if i != 3
end
