

import java.util.Scanner;

public class Main {
	public static void main(String [] args){
		//????????£?????????????????????
		Scanner sc = new Scanner(System.in);
		//?????¶????????±?????????
		int n = sc.nextInt();
		//3?¬?????????? ?£? ??? ??¨?±??????? ?????°??????????????????
		//?????? 4?£? 3????????? 10??¨?±?
		int  [][][] list = new int[4][3][10];
		//??¨????????¨?±??????????
		//b ?£?
		for(int i = 0; i < 4; i++){
			//f ???
			for(int j= 0 ; j< 3; j++){
				//r ??¨?±???????
				for(int k =0; k < 10; k++ ){
					//?£? ??? ??¨?±??????????
					list [i][j][k] = 0;
				}
			}
		}
		//???????????¨???
		for(int i =0; i <n;i++){
			//?????????0?????????????§????????????? ?£? ??? ??¨?±??????????????????????v ?????°???????´?
			list [sc.nextInt() - 1][sc.nextInt() - 1][sc.nextInt() - 1] +=  sc.nextInt();
		}
		//??¨???
		//b ?£?
		for(int i = 0; i < 4; i++){
			//f ???
			for(int j= 0 ; j< 3; j++){
				//r ??¨?±???????
				for(int k =0; k < 10;k++ ){
					//?£? ??? ??¨?±??????????
					System.out.print(" " + list [i][j][k] );
				}
				System.out.println();
			}
			if(i < 3){
				System.out.println("####################");
			}
		}
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String [] args){
		//????????£?????????????????????
		Scanner sc = new Scanner(System.in);
		//?????¶????????±?????????
		int n = sc.nextInt();
		//3?¬?????????? ?£? ??? ??¨?±??????? ?????°??????????????????
		//?????? 4?£? 3????????? 10??¨?±?
		int  [][][] list = new int[4][3][10];
		//??¨????????¨?±??????????
		//b ?£?
		for(int i = 0; i < 4; i++){
			//f ???
			for(int j= 0 ; j< 3; j++){
				//r ??¨?±???????
				for(int k =0; k < 10; k++ ){
					//?£? ??? ??¨?±??????????
					list [i][j][k] = 0;
				}
			}
		}
		//???????????¨???
		for(int i =0; i <n;i++){
			//?????????0?????????????§????????????? ?£? ??? ??¨?±??????????????????????v ?????°???????´?
			list [sc.nextInt() - 1][sc.nextInt() - 1][sc.nextInt() - 1] +=  sc.nextInt();
		}
		//??¨???
		//b ?£?
		for(int i = 0; i < 4; i++){
			//f ???
			for(int j= 0 ; j< 3; j++){
				//r ??¨?±???????
				for(int k =0; k < 10;k++ ){
					//?£? ??? ??¨?±??????????
					System.out.print(" " + list [i][j][k] );
				}
				System.out.println();
			}
			if(i < 3){
				System.out.println("####################");
			}
		}
	}
} Main public static void main(String [] args){
		//????????£?????????????????????
		Scanner sc = new Scanner(System.in);
		//?????¶????????±?????????
		int n = sc.nextInt();
		//3?¬?????????? ?£? ??? ??¨?±??????? ?????°??????????????????
		//?????? 4?£? 3????????? 10??¨?±?
		int  [][][] list = new int[4][3][10];
		//??¨????????¨?±??????????
		//b ?£?
		for(int i = 0; i < 4; i++){
			//f ???
			for(int j= 0 ; j< 3; j++){
				//r ??¨?±???????
				for(int k =0; k < 10; k++ ){
					//?£? ??? ??¨?±??????????
					list [i][j][k] = 0;
				}
			}
		}
		//???????????¨???
		for(int i =0; i <n;i++){
			//?????????0?????????????§????????????? ?£? ??? ??¨?±??????????????????????v ?????°???????´?
			list [sc.nextInt() - 1][sc.nextInt() - 1][sc.nextInt() - 1] +=  sc.nextInt();
		}
		//??¨???
		//b ?£?
		for(int i = 0; i < 4; i++){
			//f ???
			for(int j= 0 ; j< 3; j++){
				//r ??¨?±???????
				for(int k =0; k < 10;k++ ){
					//?£? ??? ??¨?±??????????
					System.out.print(" " + list [i][j][k] );
				}
				System.out.println();
			}
			if(i < 3){
				System.out.println("####################");
			}
		}
	} main {
		//????????£?????????????????????
		Scanner sc = new Scanner(System.in);
		//?????¶????????±?????????
		int n = sc.nextInt();
		//3?¬?????????? ?£? ??? ??¨?±??????? ?????°??????????????????
		//?????? 4?£? 3????????? 10??¨?±?
		int  [][][] list = new int[4][3][10];
		//??¨????????¨?±??????????
		//b ?£?
		for(int i = 0; i < 4; i++){
			//f ???
			for(int j= 0 ; j< 3; j++){
				//r ??¨?±???????
				for(int k =0; k < 10; k++ ){
					//?£? ??? ??¨?±??????????
					list [i][j][k] = 0;
				}
			}
		}
		//???????????¨???
		for(int i =0; i <n;i++){
			//?????????0?????????????§????????????? ?£? ??? ??¨?±??????????????????????v ?????°???????´?
			list [sc.nextInt() - 1][sc.nextInt() - 1][sc.nextInt() - 1] +=  sc.nextInt();
		}
		//??¨???
		//b ?£?
		for(int i = 0; i < 4; i++){
			//f ???
			for(int j= 0 ; j< 3; j++){
				//r ??¨?±???????
				for(int k =0; k < 10;k++ ){
					//?£? ??? ??¨?±??????????
					System.out.print(" " + list [i][j][k] );
				}
				System.out.println();
			}
			if(i < 3){
				System.out.println("####################");
			}
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int  [][][] list = new int[4][3][10]; list new int[4][3][10] 4 3 10 for(int i = 0; i < 4; i++){
			//f ???
			for(int j= 0 ; j< 3; j++){
				//r ??¨?±???????
				for(int k =0; k < 10; k++ ){
					//?£? ??? ??¨?±??????????
					list [i][j][k] = 0;
				}
			}
		} int i = 0; int i = 0; i 0 i < 4 i 4 i++ i++ i {
			//f ???
			for(int j= 0 ; j< 3; j++){
				//r ??¨?±???????
				for(int k =0; k < 10; k++ ){
					//?£? ??? ??¨?±??????????
					list [i][j][k] = 0;
				}
			}
		} {
			//f ???
			for(int j= 0 ; j< 3; j++){
				//r ??¨?±???????
				for(int k =0; k < 10; k++ ){
					//?£? ??? ??¨?±??????????
					list [i][j][k] = 0;
				}
			}
		} for(int j= 0 ; j< 3; j++){
				//r ??¨?±???????
				for(int k =0; k < 10; k++ ){
					//?£? ??? ??¨?±??????????
					list [i][j][k] = 0;
				}
			} int j= 0 ; int j= 0 ; j 0 j< 3 j 3 j++ j++ j {
				//r ??¨?±???????
				for(int k =0; k < 10; k++ ){
					//?£? ??? ??¨?±??????????
					list [i][j][k] = 0;
				}
			} {
				//r ??¨?±???????
				for(int k =0; k < 10; k++ ){
					//?£? ??? ??¨?±??????????
					list [i][j][k] = 0;
				}
			} for(int k =0; k < 10; k++ ){
					//?£? ??? ??¨?±??????????
					list [i][j][k] = 0;
				} int k =0; int k =0; k 0 k < 10 k 10 k++ k++ k {
					//?£? ??? ??¨?±??????????
					list [i][j][k] = 0;
				} {
					//?£? ??? ??¨?±??????????
					list [i][j][k] = 0;
				} list [i][j][k] = 0 list [i][j][k] list [i][j] list [i] list i j k 0 for(int i =0; i <n;i++){
			//?????????0?????????????§????????????? ?£? ??? ??¨?±??????????????????????v ?????°???????´?
			list [sc.nextInt() - 1][sc.nextInt() - 1][sc.nextInt() - 1] +=  sc.nextInt();
		} int i =0; int i =0; i 0 i <n i n i++ i++ i {
			//?????????0?????????????§????????????? ?£? ??? ??¨?±??????????????????????v ?????°???????´?
			list [sc.nextInt() - 1][sc.nextInt() - 1][sc.nextInt() - 1] +=  sc.nextInt();
		} {
			//?????????0?????????????§????????????? ?£? ??? ??¨?±??????????????????????v ?????°???????´?
			list [sc.nextInt() - 1][sc.nextInt() - 1][sc.nextInt() - 1] +=  sc.nextInt();
		} list [sc.nextInt() - 1][sc.nextInt() - 1][sc.nextInt() - 1] +=  sc.nextInt() list [sc.nextInt() - 1][sc.nextInt() - 1][sc.nextInt() - 1] list [sc.nextInt() - 1][sc.nextInt() - 1] list [sc.nextInt() - 1] list sc.nextInt() - 1 sc.nextInt() sc.nextInt sc 1 sc.nextInt() - 1 sc.nextInt() sc.nextInt sc 1 sc.nextInt() - 1 sc.nextInt() sc.nextInt sc 1 sc.nextInt() sc.nextInt sc for(int i = 0; i < 4; i++){
			//f ???
			for(int j= 0 ; j< 3; j++){
				//r ??¨?±???????
				for(int k =0; k < 10;k++ ){
					//?£? ??? ??¨?±??????????
					System.out.print(" " + list [i][j][k] );
				}
				System.out.println();
			}
			if(i < 3){
				System.out.println("####################");
			}
		} int i = 0; int i = 0; i 0 i < 4 i 4 i++ i++ i {
			//f ???
			for(int j= 0 ; j< 3; j++){
				//r ??¨?±???????
				for(int k =0; k < 10;k++ ){
					//?£? ??? ??¨?±??????????
					System.out.print(" " + list [i][j][k] );
				}
				System.out.println();
			}
			if(i < 3){
				System.out.println("####################");
			}
		} {
			//f ???
			for(int j= 0 ; j< 3; j++){
				//r ??¨?±???????
				for(int k =0; k < 10;k++ ){
					//?£? ??? ??¨?±??????????
					System.out.print(" " + list [i][j][k] );
				}
				System.out.println();
			}
			if(i < 3){
				System.out.println("####################");
			}
		} for(int j= 0 ; j< 3; j++){
				//r ??¨?±???????
				for(int k =0; k < 10;k++ ){
					//?£? ??? ??¨?±??????????
					System.out.print(" " + list [i][j][k] );
				}
				System.out.println();
			} int j= 0 ; int j= 0 ; j 0 j< 3 j 3 j++ j++ j {
				//r ??¨?±???????
				for(int k =0; k < 10;k++ ){
					//?£? ??? ??¨?±??????????
					System.out.print(" " + list [i][j][k] );
				}
				System.out.println();
			} {
				//r ??¨?±???????
				for(int k =0; k < 10;k++ ){
					//?£? ??? ??¨?±??????????
					System.out.print(" " + list [i][j][k] );
				}
				System.out.println();
			} for(int k =0; k < 10;k++ ){
					//?£? ??? ??¨?±??????????
					System.out.print(" " + list [i][j][k] );
				} int k =0; int k =0; k 0 k < 10 k 10 k++ k++ k {
					//?£? ??? ??¨?±??????????
					System.out.print(" " + list [i][j][k] );
				} {
					//?£? ??? ??¨?±??????????
					System.out.print(" " + list [i][j][k] );
				} System.out.print(" " + list [i][j][k] ) System.out.print System.out System System.out " " + list [i][j][k] " " list [i][j][k] list [i][j] list [i] list i j k System.out.println() System.out.println System.out System System.out if(i < 3){
				System.out.println("####################");
			} i < 3 i 3 {
				System.out.println("####################");
			} System.out.println("####################") System.out.println System.out System System.out "####################" String [] args args public class Main {
	public static void main(String [] args){
		//????????£?????????????????????
		Scanner sc = new Scanner(System.in);
		//?????¶????????±?????????
		int n = sc.nextInt();
		//3?¬?????????? ?£? ??? ??¨?±??????? ?????°??????????????????
		//?????? 4?£? 3????????? 10??¨?±?
		int  [][][] list = new int[4][3][10];
		//??¨????????¨?±??????????
		//b ?£?
		for(int i = 0; i < 4; i++){
			//f ???
			for(int j= 0 ; j< 3; j++){
				//r ??¨?±???????
				for(int k =0; k < 10; k++ ){
					//?£? ??? ??¨?±??????????
					list [i][j][k] = 0;
				}
			}
		}
		//???????????¨???
		for(int i =0; i <n;i++){
			//?????????0?????????????§????????????? ?£? ??? ??¨?±??????????????????????v ?????°???????´?
			list [sc.nextInt() - 1][sc.nextInt() - 1][sc.nextInt() - 1] +=  sc.nextInt();
		}
		//??¨???
		//b ?£?
		for(int i = 0; i < 4; i++){
			//f ???
			for(int j= 0 ; j< 3; j++){
				//r ??¨?±???????
				for(int k =0; k < 10;k++ ){
					//?£? ??? ??¨?±??????????
					System.out.print(" " + list [i][j][k] );
				}
				System.out.println();
			}
			if(i < 3){
				System.out.println("####################");
			}
		}
	}
} public class Main {
	public static void main(String [] args){
		//????????£?????????????????????
		Scanner sc = new Scanner(System.in);
		//?????¶????????±?????????
		int n = sc.nextInt();
		//3?¬?????????? ?£? ??? ??¨?±??????? ?????°??????????????????
		//?????? 4?£? 3????????? 10??¨?±?
		int  [][][] list = new int[4][3][10];
		//??¨????????¨?±??????????
		//b ?£?
		for(int i = 0; i < 4; i++){
			//f ???
			for(int j= 0 ; j< 3; j++){
				//r ??¨?±???????
				for(int k =0; k < 10; k++ ){
					//?£? ??? ??¨?±??????????
					list [i][j][k] = 0;
				}
			}
		}
		//???????????¨???
		for(int i =0; i <n;i++){
			//?????????0?????????????§????????????? ?£? ??? ??¨?±??????????????????????v ?????°???????´?
			list [sc.nextInt() - 1][sc.nextInt() - 1][sc.nextInt() - 1] +=  sc.nextInt();
		}
		//??¨???
		//b ?£?
		for(int i = 0; i < 4; i++){
			//f ???
			for(int j= 0 ; j< 3; j++){
				//r ??¨?±???????
				for(int k =0; k < 10;k++ ){
					//?£? ??? ??¨?±??????????
					System.out.print(" " + list [i][j][k] );
				}
				System.out.println();
			}
			if(i < 3){
				System.out.println("####################");
			}
		}
	}
} Main


import java.util.Scanner;

public class Main {
	public static void main(String [] args){
		//????????£?????????????????????
		Scanner sc = new Scanner(System.in);
		//?????¶????????±?????????
		int n = sc.nextInt();
		//3?¬?????????? ?£? ??? ??¨?±??????? ?????°??????????????????
		//?????? 4?£? 3????????? 10??¨?±?
		int  [][][] list = new int[4][3][10];
		//??¨????????¨?±??????????
		//b ?£?
		for(int i = 0; i < 4; i++){
			//f ???
			for(int j= 0 ; j< 3; j++){
				//r ??¨?±???????
				for(int k =0; k < 10; k++ ){
					//?£? ??? ??¨?±??????????
					list [i][j][k] = 0;
				}
			}
		}
		//???????????¨???
		for(int i =0; i <n;i++){
			//?????????0?????????????§????????????? ?£? ??? ??¨?±??????????????????????v ?????°???????´?
			list [sc.nextInt() - 1][sc.nextInt() - 1][sc.nextInt() - 1] +=  sc.nextInt();
		}
		//??¨???
		//b ?£?
		for(int i = 0; i < 4; i++){
			//f ???
			for(int j= 0 ; j< 3; j++){
				//r ??¨?±???????
				for(int k =0; k < 10;k++ ){
					//?£? ??? ??¨?±??????????
					System.out.print(" " + list [i][j][k] );
				}
				System.out.println();
			}
			if(i < 3){
				System.out.println("####################");
			}
		}
	}
}