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

public class Main{
	public static void main(String[] args)throws IOException{
	
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb = new StringBuilder();
		
		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.println();
			}
		}
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.io.IOException; IOException java.io public class Main{
	public static void main(String[] args)throws IOException{
	
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb = new StringBuilder();
		
		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.println();
			}
		}
	}
} Main public static void main(String[] args)throws IOException{
	
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb = new StringBuilder();
		
		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.println();
			}
		}
	} main {
	
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb = new StringBuilder();
		
		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.println();
			}
		}
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) StringBuilder sb = new StringBuilder(); sb new StringBuilder() 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.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(count[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(count[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(count[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(count[i][j][k]);
				}
				System.out.println();
			} {
				for(int k=0; k<10; k++){
					System.out.print(" ");
					System.out.print(count[i][j][k]);
				}
				System.out.println();
			} 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.println() System.out.println System.out System System.out String[] args args public class Main{
	public static void main(String[] args)throws IOException{
	
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb = new StringBuilder();
		
		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.println();
			}
		}
	}
} public class Main{
	public static void main(String[] args)throws IOException{
	
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb = new StringBuilder();
		
		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.println();
			}
		}
	}
} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;

public class Main{
	public static void main(String[] args)throws IOException{
	
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb = new StringBuilder();
		
		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.println();
			}
		}
	}
}