import java.io.*;

class Main {
	public static void main(String[] args) throws Exception {
		int A[][][] = new int[4][3][10];
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int N = Integer.parseInt(br.readLine());
        for(int i=0;i<N;i++){
            String[] array = br.readLine().split(" ");
            int b = Integer.parseInt(array[0])-1;
            int f = Integer.parseInt(array[1])-1;
            int r = Integer.parseInt(array[2])-1;
            int v = Integer.parseInt(array[3]);
            A[b][f][r]+=v;
        }
        for(int i=0;i<4;i++){
        	for(int j=0;j<3;j++){
        		for(int k=0;k<10;k++){
        			System.out.print(" "+A[i][j][k]);
        		}
        		System.out.println("");
        	}
        	if(i<3) System.out.println("####################");
        }
	}
} import java.io.*; io.* java class Main {
	public static void main(String[] args) throws Exception {
		int A[][][] = new int[4][3][10];
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int N = Integer.parseInt(br.readLine());
        for(int i=0;i<N;i++){
            String[] array = br.readLine().split(" ");
            int b = Integer.parseInt(array[0])-1;
            int f = Integer.parseInt(array[1])-1;
            int r = Integer.parseInt(array[2])-1;
            int v = Integer.parseInt(array[3]);
            A[b][f][r]+=v;
        }
        for(int i=0;i<4;i++){
        	for(int j=0;j<3;j++){
        		for(int k=0;k<10;k++){
        			System.out.print(" "+A[i][j][k]);
        		}
        		System.out.println("");
        	}
        	if(i<3) System.out.println("####################");
        }
	}
} Main public static void main(String[] args) throws Exception {
		int A[][][] = new int[4][3][10];
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int N = Integer.parseInt(br.readLine());
        for(int i=0;i<N;i++){
            String[] array = br.readLine().split(" ");
            int b = Integer.parseInt(array[0])-1;
            int f = Integer.parseInt(array[1])-1;
            int r = Integer.parseInt(array[2])-1;
            int v = Integer.parseInt(array[3]);
            A[b][f][r]+=v;
        }
        for(int i=0;i<4;i++){
        	for(int j=0;j<3;j++){
        		for(int k=0;k<10;k++){
        			System.out.print(" "+A[i][j][k]);
        		}
        		System.out.println("");
        	}
        	if(i<3) System.out.println("####################");
        }
	} main {
		int A[][][] = new int[4][3][10];
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int N = Integer.parseInt(br.readLine());
        for(int i=0;i<N;i++){
            String[] array = br.readLine().split(" ");
            int b = Integer.parseInt(array[0])-1;
            int f = Integer.parseInt(array[1])-1;
            int r = Integer.parseInt(array[2])-1;
            int v = Integer.parseInt(array[3]);
            A[b][f][r]+=v;
        }
        for(int i=0;i<4;i++){
        	for(int j=0;j<3;j++){
        		for(int k=0;k<10;k++){
        			System.out.print(" "+A[i][j][k]);
        		}
        		System.out.println("");
        	}
        	if(i<3) System.out.println("####################");
        }
	} int A[][][] = new int[4][3][10]; A new int[4][3][10] 4 3 10 BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) int N = Integer.parseInt(br.readLine()); N Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br for(int i=0;i<N;i++){
            String[] array = br.readLine().split(" ");
            int b = Integer.parseInt(array[0])-1;
            int f = Integer.parseInt(array[1])-1;
            int r = Integer.parseInt(array[2])-1;
            int v = Integer.parseInt(array[3]);
            A[b][f][r]+=v;
        } int i=0; int i=0; i 0 i<N i N i++ i++ i {
            String[] array = br.readLine().split(" ");
            int b = Integer.parseInt(array[0])-1;
            int f = Integer.parseInt(array[1])-1;
            int r = Integer.parseInt(array[2])-1;
            int v = Integer.parseInt(array[3]);
            A[b][f][r]+=v;
        } {
            String[] array = br.readLine().split(" ");
            int b = Integer.parseInt(array[0])-1;
            int f = Integer.parseInt(array[1])-1;
            int r = Integer.parseInt(array[2])-1;
            int v = Integer.parseInt(array[3]);
            A[b][f][r]+=v;
        } String[] array = br.readLine().split(" "); array br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " int b = Integer.parseInt(array[0])-1; b Integer.parseInt(array[0])-1 Integer.parseInt(array[0]) Integer.parseInt Integer array[0] array 0 1 int f = Integer.parseInt(array[1])-1; f Integer.parseInt(array[1])-1 Integer.parseInt(array[1]) Integer.parseInt Integer array[1] array 1 1 int r = Integer.parseInt(array[2])-1; r Integer.parseInt(array[2])-1 Integer.parseInt(array[2]) Integer.parseInt Integer array[2] array 2 1 int v = Integer.parseInt(array[3]); v Integer.parseInt(array[3]) Integer.parseInt Integer array[3] array 3 A[b][f][r]+=v A[b][f][r] A[b][f] A[b] A b f r v for(int i=0;i<4;i++){
        	for(int j=0;j<3;j++){
        		for(int k=0;k<10;k++){
        			System.out.print(" "+A[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 {
        	for(int j=0;j<3;j++){
        		for(int k=0;k<10;k++){
        			System.out.print(" "+A[i][j][k]);
        		}
        		System.out.println("");
        	}
        	if(i<3) System.out.println("####################");
        } {
        	for(int j=0;j<3;j++){
        		for(int k=0;k<10;k++){
        			System.out.print(" "+A[i][j][k]);
        		}
        		System.out.println("");
        	}
        	if(i<3) System.out.println("####################");
        } for(int j=0;j<3;j++){
        		for(int k=0;k<10;k++){
        			System.out.print(" "+A[i][j][k]);
        		}
        		System.out.println("");
        	} int j=0; int j=0; j 0 j<3 j 3 j++ j++ j {
        		for(int k=0;k<10;k++){
        			System.out.print(" "+A[i][j][k]);
        		}
        		System.out.println("");
        	} {
        		for(int k=0;k<10;k++){
        			System.out.print(" "+A[i][j][k]);
        		}
        		System.out.println("");
        	} for(int k=0;k<10;k++){
        			System.out.print(" "+A[i][j][k]);
        		} int k=0; int k=0; k 0 k<10 k 10 k++ k++ k {
        			System.out.print(" "+A[i][j][k]);
        		} {
        			System.out.print(" "+A[i][j][k]);
        		} System.out.print(" "+A[i][j][k]) System.out.print System.out System System.out " "+A[i][j][k] " " A[i][j][k] A[i][j] A[i] A 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 System System.out "####################" String[] args args
import java.io.*;

class Main {
	public static void main(String[] args) throws Exception {
		int A[][][] = new int[4][3][10];
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int N = Integer.parseInt(br.readLine());
        for(int i=0;i<N;i++){
            String[] array = br.readLine().split(" ");
            int b = Integer.parseInt(array[0])-1;
            int f = Integer.parseInt(array[1])-1;
            int r = Integer.parseInt(array[2])-1;
            int v = Integer.parseInt(array[3]);
            A[b][f][r]+=v;
        }
        for(int i=0;i<4;i++){
        	for(int j=0;j<3;j++){
        		for(int k=0;k<10;k++){
        			System.out.print(" "+A[i][j][k]);
        		}
        		System.out.println("");
        	}
        	if(i<3) System.out.println("####################");
        }
	}
}