#include <cstdio>

int main(int argc, char const *argv[])
{
	int n,b,f,r,v;
	int m[4][3][10] = {0};

	scanf("%d\n",&n);
	for(int i = 0; i < n ; i ++){
		scanf("%d %d %d %d\n",&b,&f,&r,&v);
		m[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++){
				printf(" %d",m[i][j][k]);
			}
			putchar('\n');
		}
		if(i<3)printf("####################\n");
	}

	return 0;
}
