import java.util.Scanner;

public class Main{
	public static void main(String[] args){

		Scanner scan = new Scanner(System.in);

		int[][][] room = new int[5][4][11]; //4?£????3??????10?????????????¬??????????

		int n = scan.nextInt(); //?????±?????°
		int b = 0; 				//?£??????°
		int f = 0;				//?????°
		int r = 0;   			//??¨?±??????????
		int v = 0;				//????????°

		for(int i = 0; i < n; i++){ //????¨?????????±?????\???????????±????????°?????°?????????
			 b = scan.nextInt();
			 f = scan.nextInt();
			 r = scan.nextInt();
			 v = scan.nextInt();

			room[b][f][r] = room[b][f][r] + v;
		}

		for(int i = 1; i <= 4; i++){
			for(int j = 1; j <= 3; j++){
				for(int k = 1; k <= 10; k++){
						System.out.print(" " + room[i][j][k]);
				}
				System.out.println();
			}
			if(i != 4 ){
				System.out.println("####################");
			}
		}
	}
} import java.util.Scanner; Scanner java.util public class Main{
	public static void main(String[] args){

		Scanner scan = new Scanner(System.in);

		int[][][] room = new int[5][4][11]; //4?£????3??????10?????????????¬??????????

		int n = scan.nextInt(); //?????±?????°
		int b = 0; 				//?£??????°
		int f = 0;				//?????°
		int r = 0;   			//??¨?±??????????
		int v = 0;				//????????°

		for(int i = 0; i < n; i++){ //????¨?????????±?????\???????????±????????°?????°?????????
			 b = scan.nextInt();
			 f = scan.nextInt();
			 r = scan.nextInt();
			 v = scan.nextInt();

			room[b][f][r] = room[b][f][r] + v;
		}

		for(int i = 1; i <= 4; i++){
			for(int j = 1; j <= 3; j++){
				for(int k = 1; k <= 10; k++){
						System.out.print(" " + room[i][j][k]);
				}
				System.out.println();
			}
			if(i != 4 ){
				System.out.println("####################");
			}
		}
	}
} Main public static void main(String[] args){

		Scanner scan = new Scanner(System.in);

		int[][][] room = new int[5][4][11]; //4?£????3??????10?????????????¬??????????

		int n = scan.nextInt(); //?????±?????°
		int b = 0; 				//?£??????°
		int f = 0;				//?????°
		int r = 0;   			//??¨?±??????????
		int v = 0;				//????????°

		for(int i = 0; i < n; i++){ //????¨?????????±?????\???????????±????????°?????°?????????
			 b = scan.nextInt();
			 f = scan.nextInt();
			 r = scan.nextInt();
			 v = scan.nextInt();

			room[b][f][r] = room[b][f][r] + v;
		}

		for(int i = 1; i <= 4; i++){
			for(int j = 1; j <= 3; j++){
				for(int k = 1; k <= 10; k++){
						System.out.print(" " + room[i][j][k]);
				}
				System.out.println();
			}
			if(i != 4 ){
				System.out.println("####################");
			}
		}
	} main {

		Scanner scan = new Scanner(System.in);

		int[][][] room = new int[5][4][11]; //4?£????3??????10?????????????¬??????????

		int n = scan.nextInt(); //?????±?????°
		int b = 0; 				//?£??????°
		int f = 0;				//?????°
		int r = 0;   			//??¨?±??????????
		int v = 0;				//????????°

		for(int i = 0; i < n; i++){ //????¨?????????±?????\???????????±????????°?????°?????????
			 b = scan.nextInt();
			 f = scan.nextInt();
			 r = scan.nextInt();
			 v = scan.nextInt();

			room[b][f][r] = room[b][f][r] + v;
		}

		for(int i = 1; i <= 4; i++){
			for(int j = 1; j <= 3; j++){
				for(int k = 1; k <= 10; k++){
						System.out.print(" " + room[i][j][k]);
				}
				System.out.println();
			}
			if(i != 4 ){
				System.out.println("####################");
			}
		}
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int[][][] room = new int[5][4][11]; room new int[5][4][11] 5 4 11 int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan int b = 0; b 0 int f = 0; f 0 int r = 0; r 0 int v = 0; v 0 for(int i = 0; i < n; i++){ //????¨?????????±?????\???????????±????????°?????°?????????
			 b = scan.nextInt();
			 f = scan.nextInt();
			 r = scan.nextInt();
			 v = scan.nextInt();

			room[b][f][r] = room[b][f][r] + v;
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i { //????¨?????????±?????\???????????±????????°?????°?????????
			 b = scan.nextInt();
			 f = scan.nextInt();
			 r = scan.nextInt();
			 v = scan.nextInt();

			room[b][f][r] = room[b][f][r] + v;
		} { //????¨?????????±?????\???????????±????????°?????°?????????
			 b = scan.nextInt();
			 f = scan.nextInt();
			 r = scan.nextInt();
			 v = scan.nextInt();

			room[b][f][r] = room[b][f][r] + v;
		} b = scan.nextInt() b scan.nextInt() scan.nextInt scan f = scan.nextInt() f scan.nextInt() scan.nextInt scan r = scan.nextInt() r scan.nextInt() scan.nextInt scan v = scan.nextInt() v scan.nextInt() scan.nextInt scan room[b][f][r] = room[b][f][r] + v room[b][f][r] room[b][f] room[b] room b f r room[b][f][r] + v room[b][f][r] room[b][f] room[b] room b f r v for(int i = 1; i <= 4; i++){
			for(int j = 1; j <= 3; j++){
				for(int k = 1; k <= 10; k++){
						System.out.print(" " + room[i][j][k]);
				}
				System.out.println();
			}
			if(i != 4 ){
				System.out.println("####################");
			}
		} int i = 1; int i = 1; i 1 i <= 4 i 4 i++ i++ i {
			for(int j = 1; j <= 3; j++){
				for(int k = 1; k <= 10; k++){
						System.out.print(" " + room[i][j][k]);
				}
				System.out.println();
			}
			if(i != 4 ){
				System.out.println("####################");
			}
		} {
			for(int j = 1; j <= 3; j++){
				for(int k = 1; k <= 10; k++){
						System.out.print(" " + room[i][j][k]);
				}
				System.out.println();
			}
			if(i != 4 ){
				System.out.println("####################");
			}
		} for(int j = 1; j <= 3; j++){
				for(int k = 1; k <= 10; k++){
						System.out.print(" " + room[i][j][k]);
				}
				System.out.println();
			} int j = 1; int j = 1; j 1 j <= 3 j 3 j++ j++ j {
				for(int k = 1; k <= 10; k++){
						System.out.print(" " + room[i][j][k]);
				}
				System.out.println();
			} {
				for(int k = 1; k <= 10; k++){
						System.out.print(" " + room[i][j][k]);
				}
				System.out.println();
			} for(int k = 1; k <= 10; k++){
						System.out.print(" " + room[i][j][k]);
				} int k = 1; int k = 1; k 1 k <= 10 k 10 k++ k++ k {
						System.out.print(" " + room[i][j][k]);
				} {
						System.out.print(" " + room[i][j][k]);
				} System.out.print(" " + room[i][j][k]) System.out.print System.out System System.out " " + room[i][j][k] " " room[i][j][k] room[i][j] room[i] room i j k System.out.println() System.out.println System.out System System.out if(i != 4 ){
				System.out.println("####################");
			} i != 4 i 4 {
				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 scan = new Scanner(System.in);

		int[][][] room = new int[5][4][11]; //4?£????3??????10?????????????¬??????????

		int n = scan.nextInt(); //?????±?????°
		int b = 0; 				//?£??????°
		int f = 0;				//?????°
		int r = 0;   			//??¨?±??????????
		int v = 0;				//????????°

		for(int i = 0; i < n; i++){ //????¨?????????±?????\???????????±????????°?????°?????????
			 b = scan.nextInt();
			 f = scan.nextInt();
			 r = scan.nextInt();
			 v = scan.nextInt();

			room[b][f][r] = room[b][f][r] + v;
		}

		for(int i = 1; i <= 4; i++){
			for(int j = 1; j <= 3; j++){
				for(int k = 1; k <= 10; k++){
						System.out.print(" " + room[i][j][k]);
				}
				System.out.println();
			}
			if(i != 4 ){
				System.out.println("####################");
			}
		}
	}
} public class Main{
	public static void main(String[] args){

		Scanner scan = new Scanner(System.in);

		int[][][] room = new int[5][4][11]; //4?£????3??????10?????????????¬??????????

		int n = scan.nextInt(); //?????±?????°
		int b = 0; 				//?£??????°
		int f = 0;				//?????°
		int r = 0;   			//??¨?±??????????
		int v = 0;				//????????°

		for(int i = 0; i < n; i++){ //????¨?????????±?????\???????????±????????°?????°?????????
			 b = scan.nextInt();
			 f = scan.nextInt();
			 r = scan.nextInt();
			 v = scan.nextInt();

			room[b][f][r] = room[b][f][r] + v;
		}

		for(int i = 1; i <= 4; i++){
			for(int j = 1; j <= 3; j++){
				for(int k = 1; k <= 10; k++){
						System.out.print(" " + room[i][j][k]);
				}
				System.out.println();
			}
			if(i != 4 ){
				System.out.println("####################");
			}
		}
	}
} Main
import java.util.Scanner;

public class Main{
	public static void main(String[] args){

		Scanner scan = new Scanner(System.in);

		int[][][] room = new int[5][4][11]; //4?£????3??????10?????????????¬??????????

		int n = scan.nextInt(); //?????±?????°
		int b = 0; 				//?£??????°
		int f = 0;				//?????°
		int r = 0;   			//??¨?±??????????
		int v = 0;				//????????°

		for(int i = 0; i < n; i++){ //????¨?????????±?????\???????????±????????°?????°?????????
			 b = scan.nextInt();
			 f = scan.nextInt();
			 r = scan.nextInt();
			 v = scan.nextInt();

			room[b][f][r] = room[b][f][r] + v;
		}

		for(int i = 1; i <= 4; i++){
			for(int j = 1; j <= 3; j++){
				for(int k = 1; k <= 10; k++){
						System.out.print(" " + room[i][j][k]);
				}
				System.out.println();
			}
			if(i != 4 ){
				System.out.println("####################");
			}
		}
	}
}