import java.io.*;

class Main { 
	public static void main(String[] args){
		try{
			BufferedReader  br = new BufferedReader(new InputStreamReader(System.in));
			
			int n = Integer.parseInt(br.readLine());
			
			int[][][] count = new int[4][3][10];
			
			
			for(int i = 0;i < 4;i++){
				for(int j = 0;j < 3;j++){
					for(int k = 0;k < 10;k++){
						count[i][j][k] = 0;
					}
				}
			}
						
			for(int i = 0;i < n;i++){
			String[] line = br.readLine().split(" ");
			int b = Integer.parseInt(line[0]) -1;
			int f = Integer.parseInt(line[1]) -1;
			int r = Integer.parseInt(line[2]) -1;
			int v = Integer.parseInt(line[3]);
			count[b][f][r] += v;
			}

			for(int i = 0;i < 4;i++){
				if( i != 0){
					System.out.println("####################");
				}				
				for(int j = 0;j < 3;j++){
					for(int k = 0;k < 10;k++){
						System.out.print(" ");
						System.out.print(count[i][j][k]);
					}
					System.out.print("\n");
				}
			}
		} catch(Exception e){
		}
	}
} import java.io.*; io.* java class Main { 
	public static void main(String[] args){
		try{
			BufferedReader  br = new BufferedReader(new InputStreamReader(System.in));
			
			int n = Integer.parseInt(br.readLine());
			
			int[][][] count = new int[4][3][10];
			
			
			for(int i = 0;i < 4;i++){
				for(int j = 0;j < 3;j++){
					for(int k = 0;k < 10;k++){
						count[i][j][k] = 0;
					}
				}
			}
						
			for(int i = 0;i < n;i++){
			String[] line = br.readLine().split(" ");
			int b = Integer.parseInt(line[0]) -1;
			int f = Integer.parseInt(line[1]) -1;
			int r = Integer.parseInt(line[2]) -1;
			int v = Integer.parseInt(line[3]);
			count[b][f][r] += v;
			}

			for(int i = 0;i < 4;i++){
				if( i != 0){
					System.out.println("####################");
				}				
				for(int j = 0;j < 3;j++){
					for(int k = 0;k < 10;k++){
						System.out.print(" ");
						System.out.print(count[i][j][k]);
					}
					System.out.print("\n");
				}
			}
		} catch(Exception e){
		}
	}
} Main public static void main(String[] args){
		try{
			BufferedReader  br = new BufferedReader(new InputStreamReader(System.in));
			
			int n = Integer.parseInt(br.readLine());
			
			int[][][] count = new int[4][3][10];
			
			
			for(int i = 0;i < 4;i++){
				for(int j = 0;j < 3;j++){
					for(int k = 0;k < 10;k++){
						count[i][j][k] = 0;
					}
				}
			}
						
			for(int i = 0;i < n;i++){
			String[] line = br.readLine().split(" ");
			int b = Integer.parseInt(line[0]) -1;
			int f = Integer.parseInt(line[1]) -1;
			int r = Integer.parseInt(line[2]) -1;
			int v = Integer.parseInt(line[3]);
			count[b][f][r] += v;
			}

			for(int i = 0;i < 4;i++){
				if( i != 0){
					System.out.println("####################");
				}				
				for(int j = 0;j < 3;j++){
					for(int k = 0;k < 10;k++){
						System.out.print(" ");
						System.out.print(count[i][j][k]);
					}
					System.out.print("\n");
				}
			}
		} catch(Exception e){
		}
	} main {
		try{
			BufferedReader  br = new BufferedReader(new InputStreamReader(System.in));
			
			int n = Integer.parseInt(br.readLine());
			
			int[][][] count = new int[4][3][10];
			
			
			for(int i = 0;i < 4;i++){
				for(int j = 0;j < 3;j++){
					for(int k = 0;k < 10;k++){
						count[i][j][k] = 0;
					}
				}
			}
						
			for(int i = 0;i < n;i++){
			String[] line = br.readLine().split(" ");
			int b = Integer.parseInt(line[0]) -1;
			int f = Integer.parseInt(line[1]) -1;
			int r = Integer.parseInt(line[2]) -1;
			int v = Integer.parseInt(line[3]);
			count[b][f][r] += v;
			}

			for(int i = 0;i < 4;i++){
				if( i != 0){
					System.out.println("####################");
				}				
				for(int j = 0;j < 3;j++){
					for(int k = 0;k < 10;k++){
						System.out.print(" ");
						System.out.print(count[i][j][k]);
					}
					System.out.print("\n");
				}
			}
		} catch(Exception e){
		}
	} try{
			BufferedReader  br = new BufferedReader(new InputStreamReader(System.in));
			
			int n = Integer.parseInt(br.readLine());
			
			int[][][] count = new int[4][3][10];
			
			
			for(int i = 0;i < 4;i++){
				for(int j = 0;j < 3;j++){
					for(int k = 0;k < 10;k++){
						count[i][j][k] = 0;
					}
				}
			}
						
			for(int i = 0;i < n;i++){
			String[] line = br.readLine().split(" ");
			int b = Integer.parseInt(line[0]) -1;
			int f = Integer.parseInt(line[1]) -1;
			int r = Integer.parseInt(line[2]) -1;
			int v = Integer.parseInt(line[3]);
			count[b][f][r] += v;
			}

			for(int i = 0;i < 4;i++){
				if( i != 0){
					System.out.println("####################");
				}				
				for(int j = 0;j < 3;j++){
					for(int k = 0;k < 10;k++){
						System.out.print(" ");
						System.out.print(count[i][j][k]);
					}
					System.out.print("\n");
				}
			}
		} catch(Exception e){
		} catch(Exception e){
		} Exception e {
		} {
			BufferedReader  br = new BufferedReader(new InputStreamReader(System.in));
			
			int n = Integer.parseInt(br.readLine());
			
			int[][][] count = new int[4][3][10];
			
			
			for(int i = 0;i < 4;i++){
				for(int j = 0;j < 3;j++){
					for(int k = 0;k < 10;k++){
						count[i][j][k] = 0;
					}
				}
			}
						
			for(int i = 0;i < n;i++){
			String[] line = br.readLine().split(" ");
			int b = Integer.parseInt(line[0]) -1;
			int f = Integer.parseInt(line[1]) -1;
			int r = Integer.parseInt(line[2]) -1;
			int v = Integer.parseInt(line[3]);
			count[b][f][r] += v;
			}

			for(int i = 0;i < 4;i++){
				if( i != 0){
					System.out.println("####################");
				}				
				for(int j = 0;j < 3;j++){
					for(int k = 0;k < 10;k++){
						System.out.print(" ");
						System.out.print(count[i][j][k]);
					}
					System.out.print("\n");
				}
			}
		} 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 int[][][] count = new int[4][3][10]; count new int[4][3][10] 4 3 10 for(int i = 0;i < 4;i++){
				for(int j = 0;j < 3;j++){
					for(int k = 0;k < 10;k++){
						count[i][j][k] = 0;
					}
				}
			} 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++){
						count[i][j][k] = 0;
					}
				}
			} {
				for(int j = 0;j < 3;j++){
					for(int k = 0;k < 10;k++){
						count[i][j][k] = 0;
					}
				}
			} for(int j = 0;j < 3;j++){
					for(int k = 0;k < 10;k++){
						count[i][j][k] = 0;
					}
				} int j = 0; int j = 0; j 0 j < 3 j 3 j++ j++ j {
					for(int k = 0;k < 10;k++){
						count[i][j][k] = 0;
					}
				} {
					for(int k = 0;k < 10;k++){
						count[i][j][k] = 0;
					}
				} for(int k = 0;k < 10;k++){
						count[i][j][k] = 0;
					} int k = 0; int k = 0; k 0 k < 10 k 10 k++ k++ k {
						count[i][j][k] = 0;
					} {
						count[i][j][k] = 0;
					} count[i][j][k] = 0 count[i][j][k] count[i][j] count[i] count i j k 0 for(int i = 0;i < n;i++){
			String[] line = br.readLine().split(" ");
			int b = Integer.parseInt(line[0]) -1;
			int f = Integer.parseInt(line[1]) -1;
			int r = Integer.parseInt(line[2]) -1;
			int v = Integer.parseInt(line[3]);
			count[b][f][r] += v;
			} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			String[] line = br.readLine().split(" ");
			int b = Integer.parseInt(line[0]) -1;
			int f = Integer.parseInt(line[1]) -1;
			int r = Integer.parseInt(line[2]) -1;
			int v = Integer.parseInt(line[3]);
			count[b][f][r] += v;
			} {
			String[] line = br.readLine().split(" ");
			int b = Integer.parseInt(line[0]) -1;
			int f = Integer.parseInt(line[1]) -1;
			int r = Integer.parseInt(line[2]) -1;
			int v = Integer.parseInt(line[3]);
			count[b][f][r] += v;
			} String[] line = br.readLine().split(" "); line br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " int b = Integer.parseInt(line[0]) -1; b Integer.parseInt(line[0]) -1 Integer.parseInt(line[0]) Integer.parseInt Integer line[0] line 0 1 int f = Integer.parseInt(line[1]) -1; f Integer.parseInt(line[1]) -1 Integer.parseInt(line[1]) Integer.parseInt Integer line[1] line 1 1 int r = Integer.parseInt(line[2]) -1; r Integer.parseInt(line[2]) -1 Integer.parseInt(line[2]) Integer.parseInt Integer line[2] line 2 1 int v = Integer.parseInt(line[3]); v Integer.parseInt(line[3]) Integer.parseInt Integer line[3] line 3 count[b][f][r] += v count[b][f][r] count[b][f] count[b] count b f r v for(int i = 0;i < 4;i++){
				if( i != 0){
					System.out.println("####################");
				}				
				for(int j = 0;j < 3;j++){
					for(int k = 0;k < 10;k++){
						System.out.print(" ");
						System.out.print(count[i][j][k]);
					}
					System.out.print("\n");
				}
			} int i = 0; int i = 0; i 0 i < 4 i 4 i++ i++ i {
				if( i != 0){
					System.out.println("####################");
				}				
				for(int j = 0;j < 3;j++){
					for(int k = 0;k < 10;k++){
						System.out.print(" ");
						System.out.print(count[i][j][k]);
					}
					System.out.print("\n");
				}
			} {
				if( i != 0){
					System.out.println("####################");
				}				
				for(int j = 0;j < 3;j++){
					for(int k = 0;k < 10;k++){
						System.out.print(" ");
						System.out.print(count[i][j][k]);
					}
					System.out.print("\n");
				}
			} if( i != 0){
					System.out.println("####################");
				} i != 0 i 0 {
					System.out.println("####################");
				} System.out.println("####################") System.out.println System.out System System.out "####################" for(int j = 0;j < 3;j++){
					for(int k = 0;k < 10;k++){
						System.out.print(" ");
						System.out.print(count[i][j][k]);
					}
					System.out.print("\n");
				} 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(" ");
						System.out.print(count[i][j][k]);
					}
					System.out.print("\n");
				} {
					for(int k = 0;k < 10;k++){
						System.out.print(" ");
						System.out.print(count[i][j][k]);
					}
					System.out.print("\n");
				} for(int k = 0;k < 10;k++){
						System.out.print(" ");
						System.out.print(count[i][j][k]);
					} int k = 0; int k = 0; k 0 k < 10 k 10 k++ k++ k {
						System.out.print(" ");
						System.out.print(count[i][j][k]);
					} {
						System.out.print(" ");
						System.out.print(count[i][j][k]);
					} System.out.print(" ") System.out.print System.out System System.out " " System.out.print(count[i][j][k]) System.out.print System.out System System.out count[i][j][k] count[i][j] count[i] count i j k System.out.print("\n") System.out.print System.out System System.out "\n" String[] args args
import java.io.*;

class Main { 
	public static void main(String[] args){
		try{
			BufferedReader  br = new BufferedReader(new InputStreamReader(System.in));
			
			int n = Integer.parseInt(br.readLine());
			
			int[][][] count = new int[4][3][10];
			
			
			for(int i = 0;i < 4;i++){
				for(int j = 0;j < 3;j++){
					for(int k = 0;k < 10;k++){
						count[i][j][k] = 0;
					}
				}
			}
						
			for(int i = 0;i < n;i++){
			String[] line = br.readLine().split(" ");
			int b = Integer.parseInt(line[0]) -1;
			int f = Integer.parseInt(line[1]) -1;
			int r = Integer.parseInt(line[2]) -1;
			int v = Integer.parseInt(line[3]);
			count[b][f][r] += v;
			}

			for(int i = 0;i < 4;i++){
				if( i != 0){
					System.out.println("####################");
				}				
				for(int j = 0;j < 3;j++){
					for(int k = 0;k < 10;k++){
						System.out.print(" ");
						System.out.print(count[i][j][k]);
					}
					System.out.print("\n");
				}
			}
		} catch(Exception e){
		}
	}
}