countMondai = gets.to_i;
aryBill = Array.new(4){Array.new(3){Array.new(10,0)}};

for num in 0..countMondai-1 do
	
	aryMondai = gets.split.map(&:to_i);
	
	aryBill[aryMondai[0]-1][aryMondai[1]-1][aryMondai[2]-1] += aryMondai[3];
	
end

for tou in 0..3 do
	for kai in 0..2 do
		for heya in 0..9 do
			
			print " " + aryBill[tou][kai][heya].to_s;
			
		end
		
		print "\r\n";
	end
	
	if tou != 3 then
		puts "####################";
	end
end