#include<iostream>
using namespace std;

int main() {
	int n;
	cin >> n;
	int arry[4][3][10] = { 0 };
	int t, x, y, v;
	for (int i = 0; i < n; i++) {
		cin >> t >> x >> y >> v;
		arry[t-1][x-1][y-1] += v;
	}

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


