import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????

		int kosha[][][] = new int[4][3][10];
		
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		
		// ??\???????????????????´?
		for(int i=1; true; i++){
			//??¶??°????¶???????????????????
			if (i > n) break;
			int a = scan.nextInt();
			int b = scan.nextInt();
			int c = scan.nextInt();
			int d = scan.nextInt();
			int A = a-1;
			int B = b-1;
			int C = c-1;
			int D = kosha[A][B][C];
			kosha[A][B][C] = D + d;
		}
		
		//?????????
		for (int A=0; true; A++){
			for(int B=0; B<=2; B++){
				for(int C=0; C<=9; C++){
					System.out.print(" " + (kosha[A][B][C]));
				}
				System.out.println("");
			}
			if (A==3) break;
			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