import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		int N_FLOOR = 10;
		int N_H = 3;
		int N_TO = 4;
		int table[][][] = new int[N_TO][N_H][N_FLOOR];

		int n, b, f, r, v;
		Scanner in = new Scanner(System.in);
		n = in.nextInt();
		for(int i=0;i<n;i++) {
			b = in.nextInt() - 1;
			f = in.nextInt() - 1;
			r = in.nextInt() - 1;
			v = in.nextInt();

			table[b][f][r] += v;
		}
		for(int i=0; i < N_TO;i++) {
			for(int j=0;j<N_H;j++) {
				for(int k=0;k<N_FLOOR;k++) {
					System.out.print(" "+table[i][j][k]);
				}
				System.out.println("");
			}
			if(i != N_TO-1) {
				System.out.println("####################");
			}
		}
	}
}
/tmp/hf-datasets-cache/medium/datasets/42704881117311-config-parquet-and-info-qiankunmu-Project_CodeNet-896c9d36/hub/datasets--qiankunmu--Project_CodeNet_Python800_and_Java250/snapshots/c899fde44a77ba1cc14973ed3de064e4ff3aadc7/Project_CodeNet_Java250.tar.gz