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

public class Main {

	public static void main(String[] args) throws IOException {

		int[][][] buildingInfo = new int [4][3][10];
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());

		for (int i =0; i < n; i++) {
			String[] line = br.readLine().split(" ");
			int building = Integer.parseInt(line[0]);
			int floor = Integer.parseInt(line[1]);
			int room = Integer.parseInt(line[2]);
			int v = Integer.parseInt(line[3]);
			buildingInfo[building - 1][floor - 1][room - 1] += v;
		}

		String blank = " ";
		for (int i = 0; i< buildingInfo.length; i++) {
			for (int j = 0; j < buildingInfo[0].length; j++) {
				for (int k = 0; k < buildingInfo[0][0].length; k++) {
					System.out.print(blank + buildingInfo[i][j][k]);
				}
				System.out.println("");
			}
			if (i != buildingInfo.length - 1) {
				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 IOException {

		int[][][] buildingInfo = new int [4][3][10];
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());

		for (int i =0; i < n; i++) {
			String[] line = br.readLine().split(" ");
			int building = Integer.parseInt(line[0]);
			int floor = Integer.parseInt(line[1]);
			int room = Integer.parseInt(line[2]);
			int v = Integer.parseInt(line[3]);
			buildingInfo[building - 1][floor - 1][room - 1] += v;
		}

		String blank = " ";
		for (int i = 0; i< buildingInfo.length; i++) {
			for (int j = 0; j < buildingInfo[0].length; j++) {
				for (int k = 0; k < buildingInfo[0][0].length; k++) {
					System.out.print(blank + buildingInfo[i][j][k]);
				}
				System.out.println("");
			}
			if (i != buildingInfo.length - 1) {
				System.out.println("####################");
			}
		}
	}
} Main public static void main(String[] args) throws IOException {

		int[][][] buildingInfo = new int [4][3][10];
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());

		for (int i =0; i < n; i++) {
			String[] line = br.readLine().split(" ");
			int building = Integer.parseInt(line[0]);
			int floor = Integer.parseInt(line[1]);
			int room = Integer.parseInt(line[2]);
			int v = Integer.parseInt(line[3]);
			buildingInfo[building - 1][floor - 1][room - 1] += v;
		}

		String blank = " ";
		for (int i = 0; i< buildingInfo.length; i++) {
			for (int j = 0; j < buildingInfo[0].length; j++) {
				for (int k = 0; k < buildingInfo[0][0].length; k++) {
					System.out.print(blank + buildingInfo[i][j][k]);
				}
				System.out.println("");
			}
			if (i != buildingInfo.length - 1) {
				System.out.println("####################");
			}
		}
	} main {

		int[][][] buildingInfo = new int [4][3][10];
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());

		for (int i =0; i < n; i++) {
			String[] line = br.readLine().split(" ");
			int building = Integer.parseInt(line[0]);
			int floor = Integer.parseInt(line[1]);
			int room = Integer.parseInt(line[2]);
			int v = Integer.parseInt(line[3]);
			buildingInfo[building - 1][floor - 1][room - 1] += v;
		}

		String blank = " ";
		for (int i = 0; i< buildingInfo.length; i++) {
			for (int j = 0; j < buildingInfo[0].length; j++) {
				for (int k = 0; k < buildingInfo[0][0].length; k++) {
					System.out.print(blank + buildingInfo[i][j][k]);
				}
				System.out.println("");
			}
			if (i != buildingInfo.length - 1) {
				System.out.println("####################");
			}
		}
	} int[][][] buildingInfo = new int [4][3][10]; buildingInfo new int [4][3][10] 4 3 10 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 for (int i =0; i < n; i++) {
			String[] line = br.readLine().split(" ");
			int building = Integer.parseInt(line[0]);
			int floor = Integer.parseInt(line[1]);
			int room = Integer.parseInt(line[2]);
			int v = Integer.parseInt(line[3]);
			buildingInfo[building - 1][floor - 1][room - 1] += v;
		} int i =0; int i =0; i 0 i < n i n i++ i++ i {
			String[] line = br.readLine().split(" ");
			int building = Integer.parseInt(line[0]);
			int floor = Integer.parseInt(line[1]);
			int room = Integer.parseInt(line[2]);
			int v = Integer.parseInt(line[3]);
			buildingInfo[building - 1][floor - 1][room - 1] += v;
		} {
			String[] line = br.readLine().split(" ");
			int building = Integer.parseInt(line[0]);
			int floor = Integer.parseInt(line[1]);
			int room = Integer.parseInt(line[2]);
			int v = Integer.parseInt(line[3]);
			buildingInfo[building - 1][floor - 1][room - 1] += v;
		} String[] line = br.readLine().split(" "); line br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " int building = Integer.parseInt(line[0]); building Integer.parseInt(line[0]) Integer.parseInt Integer line[0] line 0 int floor = Integer.parseInt(line[1]); floor Integer.parseInt(line[1]) Integer.parseInt Integer line[1] line 1 int room = Integer.parseInt(line[2]); room Integer.parseInt(line[2]) Integer.parseInt Integer line[2] line 2 int v = Integer.parseInt(line[3]); v Integer.parseInt(line[3]) Integer.parseInt Integer line[3] line 3 buildingInfo[building - 1][floor - 1][room - 1] += v buildingInfo[building - 1][floor - 1][room - 1] buildingInfo[building - 1][floor - 1] buildingInfo[building - 1] buildingInfo building - 1 building 1 floor - 1 floor 1 room - 1 room 1 v String blank = " "; blank " " for (int i = 0; i< buildingInfo.length; i++) {
			for (int j = 0; j < buildingInfo[0].length; j++) {
				for (int k = 0; k < buildingInfo[0][0].length; k++) {
					System.out.print(blank + buildingInfo[i][j][k]);
				}
				System.out.println("");
			}
			if (i != buildingInfo.length - 1) {
				System.out.println("####################");
			}
		} int i = 0; int i = 0; i 0 i< buildingInfo.length i buildingInfo.length buildingInfo buildingInfo.length i++ i++ i {
			for (int j = 0; j < buildingInfo[0].length; j++) {
				for (int k = 0; k < buildingInfo[0][0].length; k++) {
					System.out.print(blank + buildingInfo[i][j][k]);
				}
				System.out.println("");
			}
			if (i != buildingInfo.length - 1) {
				System.out.println("####################");
			}
		} {
			for (int j = 0; j < buildingInfo[0].length; j++) {
				for (int k = 0; k < buildingInfo[0][0].length; k++) {
					System.out.print(blank + buildingInfo[i][j][k]);
				}
				System.out.println("");
			}
			if (i != buildingInfo.length - 1) {
				System.out.println("####################");
			}
		} for (int j = 0; j < buildingInfo[0].length; j++) {
				for (int k = 0; k < buildingInfo[0][0].length; k++) {
					System.out.print(blank + buildingInfo[i][j][k]);
				}
				System.out.println("");
			} int j = 0; int j = 0; j 0 j < buildingInfo[0].length j buildingInfo[0].length buildingInfo[0] buildingInfo 0 buildingInfo[0].length j++ j++ j {
				for (int k = 0; k < buildingInfo[0][0].length; k++) {
					System.out.print(blank + buildingInfo[i][j][k]);
				}
				System.out.println("");
			} {
				for (int k = 0; k < buildingInfo[0][0].length; k++) {
					System.out.print(blank + buildingInfo[i][j][k]);
				}
				System.out.println("");
			} for (int k = 0; k < buildingInfo[0][0].length; k++) {
					System.out.print(blank + buildingInfo[i][j][k]);
				} int k = 0; int k = 0; k 0 k < buildingInfo[0][0].length k buildingInfo[0][0].length buildingInfo[0][0] buildingInfo[0] buildingInfo 0 0 buildingInfo[0][0].length k++ k++ k {
					System.out.print(blank + buildingInfo[i][j][k]);
				} {
					System.out.print(blank + buildingInfo[i][j][k]);
				} System.out.print(blank + buildingInfo[i][j][k]) System.out.print System.out System System.out blank + buildingInfo[i][j][k] blank buildingInfo[i][j][k] buildingInfo[i][j] buildingInfo[i] buildingInfo i j k System.out.println("") System.out.println System.out System System.out "" if (i != buildingInfo.length - 1) {
				System.out.println("####################");
			} i != buildingInfo.length - 1 i buildingInfo.length - 1 buildingInfo.length buildingInfo buildingInfo.length 1 {
				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 {

		int[][][] buildingInfo = new int [4][3][10];
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());

		for (int i =0; i < n; i++) {
			String[] line = br.readLine().split(" ");
			int building = Integer.parseInt(line[0]);
			int floor = Integer.parseInt(line[1]);
			int room = Integer.parseInt(line[2]);
			int v = Integer.parseInt(line[3]);
			buildingInfo[building - 1][floor - 1][room - 1] += v;
		}

		String blank = " ";
		for (int i = 0; i< buildingInfo.length; i++) {
			for (int j = 0; j < buildingInfo[0].length; j++) {
				for (int k = 0; k < buildingInfo[0][0].length; k++) {
					System.out.print(blank + buildingInfo[i][j][k]);
				}
				System.out.println("");
			}
			if (i != buildingInfo.length - 1) {
				System.out.println("####################");
			}
		}
	}
} public class Main {

	public static void main(String[] args) throws IOException {

		int[][][] buildingInfo = new int [4][3][10];
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());

		for (int i =0; i < n; i++) {
			String[] line = br.readLine().split(" ");
			int building = Integer.parseInt(line[0]);
			int floor = Integer.parseInt(line[1]);
			int room = Integer.parseInt(line[2]);
			int v = Integer.parseInt(line[3]);
			buildingInfo[building - 1][floor - 1][room - 1] += v;
		}

		String blank = " ";
		for (int i = 0; i< buildingInfo.length; i++) {
			for (int j = 0; j < buildingInfo[0].length; j++) {
				for (int k = 0; k < buildingInfo[0][0].length; k++) {
					System.out.print(blank + buildingInfo[i][j][k]);
				}
				System.out.println("");
			}
			if (i != buildingInfo.length - 1) {
				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 IOException {

		int[][][] buildingInfo = new int [4][3][10];
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());

		for (int i =0; i < n; i++) {
			String[] line = br.readLine().split(" ");
			int building = Integer.parseInt(line[0]);
			int floor = Integer.parseInt(line[1]);
			int room = Integer.parseInt(line[2]);
			int v = Integer.parseInt(line[3]);
			buildingInfo[building - 1][floor - 1][room - 1] += v;
		}

		String blank = " ";
		for (int i = 0; i< buildingInfo.length; i++) {
			for (int j = 0; j < buildingInfo[0].length; j++) {
				for (int k = 0; k < buildingInfo[0][0].length; k++) {
					System.out.print(blank + buildingInfo[i][j][k]);
				}
				System.out.println("");
			}
			if (i != buildingInfo.length - 1) {
				System.out.println("####################");
			}
		}
	}
}