import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;



public class Main {
	public static void main(String[] args) throws NumberFormatException, IOException{
		
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String input = br.readLine();
		
		int[][][] house = 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++){
					house[i][j][k]=0;
				}
			}
		}
		
		int n = Integer.parseInt(input);
		
		for(int i=0;i<n;i++){
			String[] date = br.readLine().split(" ");
			
			int mune = Integer.parseInt(date[0])-1;
			int kai = Integer.parseInt(date[1])-1;
			int heya = Integer.parseInt(date[2])-1;
			int hito = Integer.parseInt(date[3]);
			
			house[mune][kai][heya] += hito;
			
		}
		
		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(house[i][j][k]);
					
				}
				System.out.println();
			}
		}
		
		
		
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {
	public static void main(String[] args) throws NumberFormatException, IOException{
		
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String input = br.readLine();
		
		int[][][] house = 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++){
					house[i][j][k]=0;
				}
			}
		}
		
		int n = Integer.parseInt(input);
		
		for(int i=0;i<n;i++){
			String[] date = br.readLine().split(" ");
			
			int mune = Integer.parseInt(date[0])-1;
			int kai = Integer.parseInt(date[1])-1;
			int heya = Integer.parseInt(date[2])-1;
			int hito = Integer.parseInt(date[3]);
			
			house[mune][kai][heya] += hito;
			
		}
		
		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(house[i][j][k]);
					
				}
				System.out.println();
			}
		}
		
		
		
	}
} Main public static void main(String[] args) throws NumberFormatException, IOException{
		
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String input = br.readLine();
		
		int[][][] house = 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++){
					house[i][j][k]=0;
				}
			}
		}
		
		int n = Integer.parseInt(input);
		
		for(int i=0;i<n;i++){
			String[] date = br.readLine().split(" ");
			
			int mune = Integer.parseInt(date[0])-1;
			int kai = Integer.parseInt(date[1])-1;
			int heya = Integer.parseInt(date[2])-1;
			int hito = Integer.parseInt(date[3]);
			
			house[mune][kai][heya] += hito;
			
		}
		
		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(house[i][j][k]);
					
				}
				System.out.println();
			}
		}
		
		
		
	} main {
		
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String input = br.readLine();
		
		int[][][] house = 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++){
					house[i][j][k]=0;
				}
			}
		}
		
		int n = Integer.parseInt(input);
		
		for(int i=0;i<n;i++){
			String[] date = br.readLine().split(" ");
			
			int mune = Integer.parseInt(date[0])-1;
			int kai = Integer.parseInt(date[1])-1;
			int heya = Integer.parseInt(date[2])-1;
			int hito = Integer.parseInt(date[3]);
			
			house[mune][kai][heya] += hito;
			
		}
		
		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(house[i][j][k]);
					
				}
				System.out.println();
			}
		}
		
		
		
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String input = br.readLine(); input br.readLine() br.readLine br int[][][] house = new int[4][3][10]; house 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++){
					house[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++){
					house[i][j][k]=0;
				}
			}
		} {
			for(int j=0;j<3;j++){
				for(int k=0;k<10;k++){
					house[i][j][k]=0;
				}
			}
		} for(int j=0;j<3;j++){
				for(int k=0;k<10;k++){
					house[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++){
					house[i][j][k]=0;
				}
			} {
				for(int k=0;k<10;k++){
					house[i][j][k]=0;
				}
			} for(int k=0;k<10;k++){
					house[i][j][k]=0;
				} int k=0; int k=0; k 0 k<10 k 10 k++ k++ k {
					house[i][j][k]=0;
				} {
					house[i][j][k]=0;
				} house[i][j][k]=0 house[i][j][k] house[i][j] house[i] house i j k 0 int n = Integer.parseInt(input); n Integer.parseInt(input) Integer.parseInt Integer input for(int i=0;i<n;i++){
			String[] date = br.readLine().split(" ");
			
			int mune = Integer.parseInt(date[0])-1;
			int kai = Integer.parseInt(date[1])-1;
			int heya = Integer.parseInt(date[2])-1;
			int hito = Integer.parseInt(date[3]);
			
			house[mune][kai][heya] += hito;
			
		} int i=0; int i=0; i 0 i<n i n i++ i++ i {
			String[] date = br.readLine().split(" ");
			
			int mune = Integer.parseInt(date[0])-1;
			int kai = Integer.parseInt(date[1])-1;
			int heya = Integer.parseInt(date[2])-1;
			int hito = Integer.parseInt(date[3]);
			
			house[mune][kai][heya] += hito;
			
		} {
			String[] date = br.readLine().split(" ");
			
			int mune = Integer.parseInt(date[0])-1;
			int kai = Integer.parseInt(date[1])-1;
			int heya = Integer.parseInt(date[2])-1;
			int hito = Integer.parseInt(date[3]);
			
			house[mune][kai][heya] += hito;
			
		} String[] date = br.readLine().split(" "); date br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " int mune = Integer.parseInt(date[0])-1; mune Integer.parseInt(date[0])-1 Integer.parseInt(date[0]) Integer.parseInt Integer date[0] date 0 1 int kai = Integer.parseInt(date[1])-1; kai Integer.parseInt(date[1])-1 Integer.parseInt(date[1]) Integer.parseInt Integer date[1] date 1 1 int heya = Integer.parseInt(date[2])-1; heya Integer.parseInt(date[2])-1 Integer.parseInt(date[2]) Integer.parseInt Integer date[2] date 2 1 int hito = Integer.parseInt(date[3]); hito Integer.parseInt(date[3]) Integer.parseInt Integer date[3] date 3 house[mune][kai][heya] += hito house[mune][kai][heya] house[mune][kai] house[mune] house mune kai heya hito 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(house[i][j][k]);
					
				}
				System.out.println();
			}
		} 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(house[i][j][k]);
					
				}
				System.out.println();
			}
		} {
			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(house[i][j][k]);
					
				}
				System.out.println();
			}
		} 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(house[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(" ");
					System.out.print(house[i][j][k]);
					
				}
				System.out.println();
			} {
				
				for(int k=0;k<10;k++){
					System.out.print(" ");
					System.out.print(house[i][j][k]);
					
				}
				System.out.println();
			} for(int k=0;k<10;k++){
					System.out.print(" ");
					System.out.print(house[i][j][k]);
					
				} int k=0; int k=0; k 0 k<10 k 10 k++ k++ k {
					System.out.print(" ");
					System.out.print(house[i][j][k]);
					
				} {
					System.out.print(" ");
					System.out.print(house[i][j][k]);
					
				} System.out.print(" ") System.out.print System.out System System.out " " System.out.print(house[i][j][k]) System.out.print System.out System System.out house[i][j][k] house[i][j] house[i] house i j k System.out.println() System.out.println System.out System System.out String[] args args public class Main {
	public static void main(String[] args) throws NumberFormatException, IOException{
		
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String input = br.readLine();
		
		int[][][] house = 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++){
					house[i][j][k]=0;
				}
			}
		}
		
		int n = Integer.parseInt(input);
		
		for(int i=0;i<n;i++){
			String[] date = br.readLine().split(" ");
			
			int mune = Integer.parseInt(date[0])-1;
			int kai = Integer.parseInt(date[1])-1;
			int heya = Integer.parseInt(date[2])-1;
			int hito = Integer.parseInt(date[3]);
			
			house[mune][kai][heya] += hito;
			
		}
		
		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(house[i][j][k]);
					
				}
				System.out.println();
			}
		}
		
		
		
	}
} public class Main {
	public static void main(String[] args) throws NumberFormatException, IOException{
		
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String input = br.readLine();
		
		int[][][] house = 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++){
					house[i][j][k]=0;
				}
			}
		}
		
		int n = Integer.parseInt(input);
		
		for(int i=0;i<n;i++){
			String[] date = br.readLine().split(" ");
			
			int mune = Integer.parseInt(date[0])-1;
			int kai = Integer.parseInt(date[1])-1;
			int heya = Integer.parseInt(date[2])-1;
			int hito = Integer.parseInt(date[3]);
			
			house[mune][kai][heya] += hito;
			
		}
		
		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(house[i][j][k]);
					
				}
				System.out.println();
			}
		}
		
		
		
	}
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;



public class Main {
	public static void main(String[] args) throws NumberFormatException, IOException{
		
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String input = br.readLine();
		
		int[][][] house = 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++){
					house[i][j][k]=0;
				}
			}
		}
		
		int n = Integer.parseInt(input);
		
		for(int i=0;i<n;i++){
			String[] date = br.readLine().split(" ");
			
			int mune = Integer.parseInt(date[0])-1;
			int kai = Integer.parseInt(date[1])-1;
			int heya = Integer.parseInt(date[2])-1;
			int hito = Integer.parseInt(date[3]);
			
			house[mune][kai][heya] += hito;
			
		}
		
		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(house[i][j][k]);
					
				}
				System.out.println();
			}
		}
		
		
		
	}
}