n = gets.chomp.to_i

room = []
4.times do |b|
	room[b] = []
	3.times do |f|
		room[b][f] = []
		10.times do |r|
			room [b][f][r] = 0
		end
	end
end

n.times do
	b, f, r, v = gets.split.map(&:to_i)

	room[b-1][f-1][r-1] += v
end

4.times do |b|
	3.times do |f|
		10.times do |r|
			print " #{room[b][f][r]}"
		end
		puts
	end
	puts '####################'
end