#include<iostream>
using namespace std;

int main() {
	int i, j, l,n;
	int m[10][3][4] = {0};
	int b, f, r, v;
	cin >> n;
	for (i = 0; i < n; i++) {
		cin >> b;
		cin >> f;
		cin >> r;
		cin >> v;
		m[r-1][f-1][b-1] = m[r-1][f-1][b-1] + v;
	}
	for (i = 0; i < 4; i++) {
		for (j = 0; j < 3; j++) {
			for (l = 0; l < 10; l++) {
				cout << " "<<m[l][j][i];
			}
			 cout << "\n";
		}
		if (i != 3)cout << "####################\n";
	}
}

