#include <iostream>

using namespace std;

int main(void){
	int n;
	int man[4][3][10] = {0};

	cin >> n;
	for(int i = 0; i < n; i++){
		int b,f,r,v;

		cin >> b >> f >> r >> v;
		man[b-1][f-1][r-1] += v;
	}

	for(int i = 0; i < 4*3*10; i++){
		if(i){
			if(!(i%10))
				cout << endl;
			if(!(i%30))
				cout << "####################" << endl;
		}

		cout << " " << *((int*)man+i);
	}
				
	cout << endl;
}

