import java.io.*;
import java.util.Arrays;

class Main{
	public static void main(String[] args)throws IOException{
		int[][][] dis = new int[4][3][10];
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int cnt = Integer.parseInt(br.readLine());
		for(int i=0; i<cnt; i++){
			String str[] = br.readLine().split(" ");
			int in[] = parseInts(str);
			dis[in[0]-1][in[1]-1][in[2]-1] = dis[in[0]-1][in[1]-1][in[2]-1] + in[3];
		}
		for(int b=0; b<4; b++){
			for(int f=0; f<3; f++){
				for(int r=0; r<10; r++){
					System.out.print(" " + dis[b][f][r]);
				}
				System.out.println();
			}
			if(b!=3)System.out.println("####################");
		}
	}
	static int[] parseInts(String[] s){
		int[] x = new int[s.length];
		for(int i=0; i<s.length; i++){
			x[i] = Integer.parseInt(s[i]);
		}
		return x;
	}
} import java.io.*; io.* java import java.util.Arrays; Arrays java.util class Main{
	public static void main(String[] args)throws IOException{
		int[][][] dis = new int[4][3][10];
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int cnt = Integer.parseInt(br.readLine());
		for(int i=0; i<cnt; i++){
			String str[] = br.readLine().split(" ");
			int in[] = parseInts(str);
			dis[in[0]-1][in[1]-1][in[2]-1] = dis[in[0]-1][in[1]-1][in[2]-1] + in[3];
		}
		for(int b=0; b<4; b++){
			for(int f=0; f<3; f++){
				for(int r=0; r<10; r++){
					System.out.print(" " + dis[b][f][r]);
				}
				System.out.println();
			}
			if(b!=3)System.out.println("####################");
		}
	}
	static int[] parseInts(String[] s){
		int[] x = new int[s.length];
		for(int i=0; i<s.length; i++){
			x[i] = Integer.parseInt(s[i]);
		}
		return x;
	}
} Main public static void main(String[] args)throws IOException{
		int[][][] dis = new int[4][3][10];
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int cnt = Integer.parseInt(br.readLine());
		for(int i=0; i<cnt; i++){
			String str[] = br.readLine().split(" ");
			int in[] = parseInts(str);
			dis[in[0]-1][in[1]-1][in[2]-1] = dis[in[0]-1][in[1]-1][in[2]-1] + in[3];
		}
		for(int b=0; b<4; b++){
			for(int f=0; f<3; f++){
				for(int r=0; r<10; r++){
					System.out.print(" " + dis[b][f][r]);
				}
				System.out.println();
			}
			if(b!=3)System.out.println("####################");
		}
	} main {
		int[][][] dis = new int[4][3][10];
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int cnt = Integer.parseInt(br.readLine());
		for(int i=0; i<cnt; i++){
			String str[] = br.readLine().split(" ");
			int in[] = parseInts(str);
			dis[in[0]-1][in[1]-1][in[2]-1] = dis[in[0]-1][in[1]-1][in[2]-1] + in[3];
		}
		for(int b=0; b<4; b++){
			for(int f=0; f<3; f++){
				for(int r=0; r<10; r++){
					System.out.print(" " + dis[b][f][r]);
				}
				System.out.println();
			}
			if(b!=3)System.out.println("####################");
		}
	} int[][][] dis = new int[4][3][10]; dis new int[4][3][10] 4 3 10 BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) int cnt = Integer.parseInt(br.readLine()); cnt Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br for(int i=0; i<cnt; i++){
			String str[] = br.readLine().split(" ");
			int in[] = parseInts(str);
			dis[in[0]-1][in[1]-1][in[2]-1] = dis[in[0]-1][in[1]-1][in[2]-1] + in[3];
		} int i=0; int i=0; i 0 i<cnt i cnt i++ i++ i {
			String str[] = br.readLine().split(" ");
			int in[] = parseInts(str);
			dis[in[0]-1][in[1]-1][in[2]-1] = dis[in[0]-1][in[1]-1][in[2]-1] + in[3];
		} {
			String str[] = br.readLine().split(" ");
			int in[] = parseInts(str);
			dis[in[0]-1][in[1]-1][in[2]-1] = dis[in[0]-1][in[1]-1][in[2]-1] + in[3];
		} String str[] = br.readLine().split(" "); str br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " int in[] = parseInts(str); in parseInts(str) parseInts str dis[in[0]-1][in[1]-1][in[2]-1] = dis[in[0]-1][in[1]-1][in[2]-1] + in[3] dis[in[0]-1][in[1]-1][in[2]-1] dis[in[0]-1][in[1]-1] dis[in[0]-1] dis in[0]-1 in[0] in 0 1 in[1]-1 in[1] in 1 1 in[2]-1 in[2] in 2 1 dis[in[0]-1][in[1]-1][in[2]-1] + in[3] dis[in[0]-1][in[1]-1][in[2]-1] dis[in[0]-1][in[1]-1] dis[in[0]-1] dis in[0]-1 in[0] in 0 1 in[1]-1 in[1] in 1 1 in[2]-1 in[2] in 2 1 in[3] in 3 for(int b=0; b<4; b++){
			for(int f=0; f<3; f++){
				for(int r=0; r<10; r++){
					System.out.print(" " + dis[b][f][r]);
				}
				System.out.println();
			}
			if(b!=3)System.out.println("####################");
		} int b=0; int b=0; b 0 b<4 b 4 b++ b++ b {
			for(int f=0; f<3; f++){
				for(int r=0; r<10; r++){
					System.out.print(" " + dis[b][f][r]);
				}
				System.out.println();
			}
			if(b!=3)System.out.println("####################");
		} {
			for(int f=0; f<3; f++){
				for(int r=0; r<10; r++){
					System.out.print(" " + dis[b][f][r]);
				}
				System.out.println();
			}
			if(b!=3)System.out.println("####################");
		} for(int f=0; f<3; f++){
				for(int r=0; r<10; r++){
					System.out.print(" " + dis[b][f][r]);
				}
				System.out.println();
			} int f=0; int f=0; f 0 f<3 f 3 f++ f++ f {
				for(int r=0; r<10; r++){
					System.out.print(" " + dis[b][f][r]);
				}
				System.out.println();
			} {
				for(int r=0; r<10; r++){
					System.out.print(" " + dis[b][f][r]);
				}
				System.out.println();
			} for(int r=0; r<10; r++){
					System.out.print(" " + dis[b][f][r]);
				} int r=0; int r=0; r 0 r<10 r 10 r++ r++ r {
					System.out.print(" " + dis[b][f][r]);
				} {
					System.out.print(" " + dis[b][f][r]);
				} System.out.print(" " + dis[b][f][r]) System.out.print System.out System System.out " " + dis[b][f][r] " " dis[b][f][r] dis[b][f] dis[b] dis b f r System.out.println() System.out.println System.out System System.out if(b!=3)System.out.println("####################"); b!=3 b 3 System.out.println("####################") System.out.println System.out System System.out "####################" String[] args args static int[] parseInts(String[] s){
		int[] x = new int[s.length];
		for(int i=0; i<s.length; i++){
			x[i] = Integer.parseInt(s[i]);
		}
		return x;
	} parseInts {
		int[] x = new int[s.length];
		for(int i=0; i<s.length; i++){
			x[i] = Integer.parseInt(s[i]);
		}
		return x;
	} int[] x = new int[s.length]; x new int[s.length] s.length s s.length for(int i=0; i<s.length; i++){
			x[i] = Integer.parseInt(s[i]);
		} int i=0; int i=0; i 0 i<s.length i s.length s s.length i++ i++ i {
			x[i] = Integer.parseInt(s[i]);
		} {
			x[i] = Integer.parseInt(s[i]);
		} x[i] = Integer.parseInt(s[i]) x[i] x i Integer.parseInt(s[i]) Integer.parseInt Integer s[i] s i return x; x String[] s s
import java.io.*;
import java.util.Arrays;

class Main{
	public static void main(String[] args)throws IOException{
		int[][][] dis = new int[4][3][10];
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int cnt = Integer.parseInt(br.readLine());
		for(int i=0; i<cnt; i++){
			String str[] = br.readLine().split(" ");
			int in[] = parseInts(str);
			dis[in[0]-1][in[1]-1][in[2]-1] = dis[in[0]-1][in[1]-1][in[2]-1] + in[3];
		}
		for(int b=0; b<4; b++){
			for(int f=0; f<3; f++){
				for(int r=0; r<10; r++){
					System.out.print(" " + dis[b][f][r]);
				}
				System.out.println();
			}
			if(b!=3)System.out.println("####################");
		}
	}
	static int[] parseInts(String[] s){
		int[] x = new int[s.length];
		for(int i=0; i<s.length; i++){
			x[i] = Integer.parseInt(s[i]);
		}
		return x;
	}
}