import java.io.*;
public class Main {
	public static void main(String[] args) throws IOException{
		BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
		String line = reader.readLine();
		int n = Integer.parseInt(line);
		int x[][] = new int[n][4];
		int y[][][] = 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++){
					y[i][j][k] = 0;
				}
			}
		}
		for(int l = 0; l < n; l++){
			String line1 = reader.readLine();
			String[] sarray = line1.split(" ", -1);
			for(int m = 0; m < 4; m++){
				x[l][m] = Integer.parseInt(sarray[m]);
			}
			y[x[l][0] - 1][x[l][1] - 1][x[l][2] - 1] += x[l][3];
		}
		for(int p = 0; p < 4; p++){
			for(int q = 0; q < 3; q++){
				for(int r = 0; r < 10; r++){
					System.out.print(" " + y[p][q][r]);
				}
				System.out.println();
			}
			if(p < 3){
				System.out.println("####################");
			}
		}
	}
} import java.io.*; io.* java public class Main {
	public static void main(String[] args) throws IOException{
		BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
		String line = reader.readLine();
		int n = Integer.parseInt(line);
		int x[][] = new int[n][4];
		int y[][][] = 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++){
					y[i][j][k] = 0;
				}
			}
		}
		for(int l = 0; l < n; l++){
			String line1 = reader.readLine();
			String[] sarray = line1.split(" ", -1);
			for(int m = 0; m < 4; m++){
				x[l][m] = Integer.parseInt(sarray[m]);
			}
			y[x[l][0] - 1][x[l][1] - 1][x[l][2] - 1] += x[l][3];
		}
		for(int p = 0; p < 4; p++){
			for(int q = 0; q < 3; q++){
				for(int r = 0; r < 10; r++){
					System.out.print(" " + y[p][q][r]);
				}
				System.out.println();
			}
			if(p < 3){
				System.out.println("####################");
			}
		}
	}
} Main public static void main(String[] args) throws IOException{
		BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
		String line = reader.readLine();
		int n = Integer.parseInt(line);
		int x[][] = new int[n][4];
		int y[][][] = 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++){
					y[i][j][k] = 0;
				}
			}
		}
		for(int l = 0; l < n; l++){
			String line1 = reader.readLine();
			String[] sarray = line1.split(" ", -1);
			for(int m = 0; m < 4; m++){
				x[l][m] = Integer.parseInt(sarray[m]);
			}
			y[x[l][0] - 1][x[l][1] - 1][x[l][2] - 1] += x[l][3];
		}
		for(int p = 0; p < 4; p++){
			for(int q = 0; q < 3; q++){
				for(int r = 0; r < 10; r++){
					System.out.print(" " + y[p][q][r]);
				}
				System.out.println();
			}
			if(p < 3){
				System.out.println("####################");
			}
		}
	} main {
		BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
		String line = reader.readLine();
		int n = Integer.parseInt(line);
		int x[][] = new int[n][4];
		int y[][][] = 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++){
					y[i][j][k] = 0;
				}
			}
		}
		for(int l = 0; l < n; l++){
			String line1 = reader.readLine();
			String[] sarray = line1.split(" ", -1);
			for(int m = 0; m < 4; m++){
				x[l][m] = Integer.parseInt(sarray[m]);
			}
			y[x[l][0] - 1][x[l][1] - 1][x[l][2] - 1] += x[l][3];
		}
		for(int p = 0; p < 4; p++){
			for(int q = 0; q < 3; q++){
				for(int r = 0; r < 10; r++){
					System.out.print(" " + y[p][q][r]);
				}
				System.out.println();
			}
			if(p < 3){
				System.out.println("####################");
			}
		}
	} BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); reader new BufferedReader(new InputStreamReader(System.in)) String line = reader.readLine(); line reader.readLine() reader.readLine reader int n = Integer.parseInt(line); n Integer.parseInt(line) Integer.parseInt Integer line int x[][] = new int[n][4]; x new int[n][4] n 4 int y[][][] = new int[4][3][10]; y 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++){
					y[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++){
					y[i][j][k] = 0;
				}
			}
		} {
			for(int j = 0; j < 3; j++){
				for(int k = 0; k < 10; k++){
					y[i][j][k] = 0;
				}
			}
		} for(int j = 0; j < 3; j++){
				for(int k = 0; k < 10; k++){
					y[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++){
					y[i][j][k] = 0;
				}
			} {
				for(int k = 0; k < 10; k++){
					y[i][j][k] = 0;
				}
			} for(int k = 0; k < 10; k++){
					y[i][j][k] = 0;
				} int k = 0; int k = 0; k 0 k < 10 k 10 k++ k++ k {
					y[i][j][k] = 0;
				} {
					y[i][j][k] = 0;
				} y[i][j][k] = 0 y[i][j][k] y[i][j] y[i] y i j k 0 for(int l = 0; l < n; l++){
			String line1 = reader.readLine();
			String[] sarray = line1.split(" ", -1);
			for(int m = 0; m < 4; m++){
				x[l][m] = Integer.parseInt(sarray[m]);
			}
			y[x[l][0] - 1][x[l][1] - 1][x[l][2] - 1] += x[l][3];
		} int l = 0; int l = 0; l 0 l < n l n l++ l++ l {
			String line1 = reader.readLine();
			String[] sarray = line1.split(" ", -1);
			for(int m = 0; m < 4; m++){
				x[l][m] = Integer.parseInt(sarray[m]);
			}
			y[x[l][0] - 1][x[l][1] - 1][x[l][2] - 1] += x[l][3];
		} {
			String line1 = reader.readLine();
			String[] sarray = line1.split(" ", -1);
			for(int m = 0; m < 4; m++){
				x[l][m] = Integer.parseInt(sarray[m]);
			}
			y[x[l][0] - 1][x[l][1] - 1][x[l][2] - 1] += x[l][3];
		} String line1 = reader.readLine(); line1 reader.readLine() reader.readLine reader String[] sarray = line1.split(" ", -1); sarray line1.split(" ", -1) line1.split line1 " " -1 1 for(int m = 0; m < 4; m++){
				x[l][m] = Integer.parseInt(sarray[m]);
			} int m = 0; int m = 0; m 0 m < 4 m 4 m++ m++ m {
				x[l][m] = Integer.parseInt(sarray[m]);
			} {
				x[l][m] = Integer.parseInt(sarray[m]);
			} x[l][m] = Integer.parseInt(sarray[m]) x[l][m] x[l] x l m Integer.parseInt(sarray[m]) Integer.parseInt Integer sarray[m] sarray m y[x[l][0] - 1][x[l][1] - 1][x[l][2] - 1] += x[l][3] y[x[l][0] - 1][x[l][1] - 1][x[l][2] - 1] y[x[l][0] - 1][x[l][1] - 1] y[x[l][0] - 1] y x[l][0] - 1 x[l][0] x[l] x l 0 1 x[l][1] - 1 x[l][1] x[l] x l 1 1 x[l][2] - 1 x[l][2] x[l] x l 2 1 x[l][3] x[l] x l 3 for(int p = 0; p < 4; p++){
			for(int q = 0; q < 3; q++){
				for(int r = 0; r < 10; r++){
					System.out.print(" " + y[p][q][r]);
				}
				System.out.println();
			}
			if(p < 3){
				System.out.println("####################");
			}
		} int p = 0; int p = 0; p 0 p < 4 p 4 p++ p++ p {
			for(int q = 0; q < 3; q++){
				for(int r = 0; r < 10; r++){
					System.out.print(" " + y[p][q][r]);
				}
				System.out.println();
			}
			if(p < 3){
				System.out.println("####################");
			}
		} {
			for(int q = 0; q < 3; q++){
				for(int r = 0; r < 10; r++){
					System.out.print(" " + y[p][q][r]);
				}
				System.out.println();
			}
			if(p < 3){
				System.out.println("####################");
			}
		} for(int q = 0; q < 3; q++){
				for(int r = 0; r < 10; r++){
					System.out.print(" " + y[p][q][r]);
				}
				System.out.println();
			} int q = 0; int q = 0; q 0 q < 3 q 3 q++ q++ q {
				for(int r = 0; r < 10; r++){
					System.out.print(" " + y[p][q][r]);
				}
				System.out.println();
			} {
				for(int r = 0; r < 10; r++){
					System.out.print(" " + y[p][q][r]);
				}
				System.out.println();
			} for(int r = 0; r < 10; r++){
					System.out.print(" " + y[p][q][r]);
				} int r = 0; int r = 0; r 0 r < 10 r 10 r++ r++ r {
					System.out.print(" " + y[p][q][r]);
				} {
					System.out.print(" " + y[p][q][r]);
				} System.out.print(" " + y[p][q][r]) System.out.print System.out System System.out " " + y[p][q][r] " " y[p][q][r] y[p][q] y[p] y p q r System.out.println() System.out.println System.out System System.out if(p < 3){
				System.out.println("####################");
			} p < 3 p 3 {
				System.out.println("####################");
			} 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 reader = new BufferedReader(new InputStreamReader(System.in));
		String line = reader.readLine();
		int n = Integer.parseInt(line);
		int x[][] = new int[n][4];
		int y[][][] = 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++){
					y[i][j][k] = 0;
				}
			}
		}
		for(int l = 0; l < n; l++){
			String line1 = reader.readLine();
			String[] sarray = line1.split(" ", -1);
			for(int m = 0; m < 4; m++){
				x[l][m] = Integer.parseInt(sarray[m]);
			}
			y[x[l][0] - 1][x[l][1] - 1][x[l][2] - 1] += x[l][3];
		}
		for(int p = 0; p < 4; p++){
			for(int q = 0; q < 3; q++){
				for(int r = 0; r < 10; r++){
					System.out.print(" " + y[p][q][r]);
				}
				System.out.println();
			}
			if(p < 3){
				System.out.println("####################");
			}
		}
	}
} public class Main {
	public static void main(String[] args) throws IOException{
		BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
		String line = reader.readLine();
		int n = Integer.parseInt(line);
		int x[][] = new int[n][4];
		int y[][][] = 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++){
					y[i][j][k] = 0;
				}
			}
		}
		for(int l = 0; l < n; l++){
			String line1 = reader.readLine();
			String[] sarray = line1.split(" ", -1);
			for(int m = 0; m < 4; m++){
				x[l][m] = Integer.parseInt(sarray[m]);
			}
			y[x[l][0] - 1][x[l][1] - 1][x[l][2] - 1] += x[l][3];
		}
		for(int p = 0; p < 4; p++){
			for(int q = 0; q < 3; q++){
				for(int r = 0; r < 10; r++){
					System.out.print(" " + y[p][q][r]);
				}
				System.out.println();
			}
			if(p < 3){
				System.out.println("####################");
			}
		}
	}
} Main
import java.io.*;
public class Main {
	public static void main(String[] args) throws IOException{
		BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
		String line = reader.readLine();
		int n = Integer.parseInt(line);
		int x[][] = new int[n][4];
		int y[][][] = 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++){
					y[i][j][k] = 0;
				}
			}
		}
		for(int l = 0; l < n; l++){
			String line1 = reader.readLine();
			String[] sarray = line1.split(" ", -1);
			for(int m = 0; m < 4; m++){
				x[l][m] = Integer.parseInt(sarray[m]);
			}
			y[x[l][0] - 1][x[l][1] - 1][x[l][2] - 1] += x[l][3];
		}
		for(int p = 0; p < 4; p++){
			for(int q = 0; q < 3; q++){
				for(int r = 0; r < 10; r++){
					System.out.print(" " + y[p][q][r]);
				}
				System.out.println();
			}
			if(p < 3){
				System.out.println("####################");
			}
		}
	}
}