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

rooms.each_with_index do |ridge, i|
  ridge.each do |floor|
    puts " " + floor.join(' ')
  end
  puts "####################" unless i == rooms.length - 1
end
