import java.util.Scanner;

class Main{

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int OffHouse[][][] = new int[4][3][10];
		for(int i=0; i<n; i++){

			int b = scan.nextInt();
			int f = scan.nextInt();
			int r = scan.nextInt();
			OffHouse[b-1][f-1][r-1] += scan.nextInt();
		}
		scan.close();
		for(int i=0; i<4; i++){ //棟
			for(int s=0; s<3; s++){ //階
				for(int t=0; t<10; t++){ //部屋
						System.out.print(" " + OffHouse[i][s][t]);
					}
				System.out.print("\n");
				if(i != 3 && s == 2)
					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