#include <iostream>
#include <bits/stdc++.h>
using namespace std;

int main()
{	
	int build[4][3][10] = {{{}}};

	int n,b,f,r,v;
	cin >> n;
	while(n--){
		cin >> b >> f >> r >>v;
		build[b-1][f-1][r-1] +=v;
	}

	for(int i=0;i<4;i++){
		for(int j=0; j<3;j++){
			for(int k=0;k<10;k++){
				cout << " ";
				cout << build[i][j][k];
			}
			cout << endl;
		}
		if(i<3)
			cout << "####################" << endl;
	}



    return 0;
}

