import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;

public class Main {

	public static void main(String[] args) throws java.lang.Exception
	{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		//?????±?????°n????¨??????????
		int n = (Integer.parseInt(br.readLine()));
		
		//n??¶????????±????????????
		ArrayList<String> list = new ArrayList<String>();
		for (int i = 0; i < n; i++) {
			list.add(br.readLine());
		}

		
		//?????????????????±???int??????????????????2?¬?????????????????´???????
		int[][] data = new int[n][4];
		for(int i = 0; i < n; i++) {
			String s = list.get(i);
			String [] ary = s.split(" ", 0);
		
			
			for(int j = 0; j < 4; j++) {	
				data[i][j] = Integer.parseInt(ary[j]);
			}
		}
		
		//?????±????????¨?????¨?±??????±????¨??????????
		int[][] building1 = new int[3][10];
		int[][] building2 = new int[3][10];
		int[][] building3 = new int[3][10];
		int[][] building4 = new int[3][10];
		for(int i = 0; i < n; i++) {
			int floor = data[i][1];
			int number = data[i][2];
			if(data[i][0] == 1) {
				building1[floor - 1][number -1] = building1[floor - 1][number -1] + data[i][3];
			}
			if(data[i][0] == 2) {
				building2[floor - 1][number -1] = building2[floor - 1][number -1] + data[i][3];
			}
			if(data[i][0] == 3) {
				building3[floor - 1][number -1] = building3[floor - 1][number -1] + data[i][3];
			}
			if(data[i][0] == 4) {
				building4[floor - 1][number -1] = building4[floor - 1][number -1] + data[i][3];
			}
		}
		
		//?????????????????????
		for(int i = 0; i < 3; i++) {
			for(int j = 0; j < 10; j++) {
				System.out.print(" " + building1[i][j]);
			}
			System.out.println();
		}
		System.out.println("####################");
		
		for(int i = 0; i < 3; i++) {
			for(int j = 0; j < 10; j++) {
				System.out.print(" " + building2[i][j]);
			}
			System.out.println();
		}
		System.out.println("####################");
		
		for(int i = 0; i < 3; i++) {
			for(int j = 0; j < 10; j++) {
				System.out.print(" " + building3[i][j]);
			}
			System.out.println();
		}
		System.out.println("####################");
		
		for(int i = 0; i < 3; i++) {
			for(int j = 0; j < 10; j++) {
				System.out.print(" " + building4[i][j]);
			}
			System.out.println();
		}
	}

} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.ArrayList; ArrayList java.util public class Main {

	public static void main(String[] args) throws java.lang.Exception
	{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		//?????±?????°n????¨??????????
		int n = (Integer.parseInt(br.readLine()));
		
		//n??¶????????±????????????
		ArrayList<String> list = new ArrayList<String>();
		for (int i = 0; i < n; i++) {
			list.add(br.readLine());
		}

		
		//?????????????????±???int??????????????????2?¬?????????????????´???????
		int[][] data = new int[n][4];
		for(int i = 0; i < n; i++) {
			String s = list.get(i);
			String [] ary = s.split(" ", 0);
		
			
			for(int j = 0; j < 4; j++) {	
				data[i][j] = Integer.parseInt(ary[j]);
			}
		}
		
		//?????±????????¨?????¨?±??????±????¨??????????
		int[][] building1 = new int[3][10];
		int[][] building2 = new int[3][10];
		int[][] building3 = new int[3][10];
		int[][] building4 = new int[3][10];
		for(int i = 0; i < n; i++) {
			int floor = data[i][1];
			int number = data[i][2];
			if(data[i][0] == 1) {
				building1[floor - 1][number -1] = building1[floor - 1][number -1] + data[i][3];
			}
			if(data[i][0] == 2) {
				building2[floor - 1][number -1] = building2[floor - 1][number -1] + data[i][3];
			}
			if(data[i][0] == 3) {
				building3[floor - 1][number -1] = building3[floor - 1][number -1] + data[i][3];
			}
			if(data[i][0] == 4) {
				building4[floor - 1][number -1] = building4[floor - 1][number -1] + data[i][3];
			}
		}
		
		//?????????????????????
		for(int i = 0; i < 3; i++) {
			for(int j = 0; j < 10; j++) {
				System.out.print(" " + building1[i][j]);
			}
			System.out.println();
		}
		System.out.println("####################");
		
		for(int i = 0; i < 3; i++) {
			for(int j = 0; j < 10; j++) {
				System.out.print(" " + building2[i][j]);
			}
			System.out.println();
		}
		System.out.println("####################");
		
		for(int i = 0; i < 3; i++) {
			for(int j = 0; j < 10; j++) {
				System.out.print(" " + building3[i][j]);
			}
			System.out.println();
		}
		System.out.println("####################");
		
		for(int i = 0; i < 3; i++) {
			for(int j = 0; j < 10; j++) {
				System.out.print(" " + building4[i][j]);
			}
			System.out.println();
		}
	}

} Main public static void main(String[] args) throws java.lang.Exception
	{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		//?????±?????°n????¨??????????
		int n = (Integer.parseInt(br.readLine()));
		
		//n??¶????????±????????????
		ArrayList<String> list = new ArrayList<String>();
		for (int i = 0; i < n; i++) {
			list.add(br.readLine());
		}

		
		//?????????????????±???int??????????????????2?¬?????????????????´???????
		int[][] data = new int[n][4];
		for(int i = 0; i < n; i++) {
			String s = list.get(i);
			String [] ary = s.split(" ", 0);
		
			
			for(int j = 0; j < 4; j++) {	
				data[i][j] = Integer.parseInt(ary[j]);
			}
		}
		
		//?????±????????¨?????¨?±??????±????¨??????????
		int[][] building1 = new int[3][10];
		int[][] building2 = new int[3][10];
		int[][] building3 = new int[3][10];
		int[][] building4 = new int[3][10];
		for(int i = 0; i < n; i++) {
			int floor = data[i][1];
			int number = data[i][2];
			if(data[i][0] == 1) {
				building1[floor - 1][number -1] = building1[floor - 1][number -1] + data[i][3];
			}
			if(data[i][0] == 2) {
				building2[floor - 1][number -1] = building2[floor - 1][number -1] + data[i][3];
			}
			if(data[i][0] == 3) {
				building3[floor - 1][number -1] = building3[floor - 1][number -1] + data[i][3];
			}
			if(data[i][0] == 4) {
				building4[floor - 1][number -1] = building4[floor - 1][number -1] + data[i][3];
			}
		}
		
		//?????????????????????
		for(int i = 0; i < 3; i++) {
			for(int j = 0; j < 10; j++) {
				System.out.print(" " + building1[i][j]);
			}
			System.out.println();
		}
		System.out.println("####################");
		
		for(int i = 0; i < 3; i++) {
			for(int j = 0; j < 10; j++) {
				System.out.print(" " + building2[i][j]);
			}
			System.out.println();
		}
		System.out.println("####################");
		
		for(int i = 0; i < 3; i++) {
			for(int j = 0; j < 10; j++) {
				System.out.print(" " + building3[i][j]);
			}
			System.out.println();
		}
		System.out.println("####################");
		
		for(int i = 0; i < 3; i++) {
			for(int j = 0; j < 10; j++) {
				System.out.print(" " + building4[i][j]);
			}
			System.out.println();
		}
	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		//?????±?????°n????¨??????????
		int n = (Integer.parseInt(br.readLine()));
		
		//n??¶????????±????????????
		ArrayList<String> list = new ArrayList<String>();
		for (int i = 0; i < n; i++) {
			list.add(br.readLine());
		}

		
		//?????????????????±???int??????????????????2?¬?????????????????´???????
		int[][] data = new int[n][4];
		for(int i = 0; i < n; i++) {
			String s = list.get(i);
			String [] ary = s.split(" ", 0);
		
			
			for(int j = 0; j < 4; j++) {	
				data[i][j] = Integer.parseInt(ary[j]);
			}
		}
		
		//?????±????????¨?????¨?±??????±????¨??????????
		int[][] building1 = new int[3][10];
		int[][] building2 = new int[3][10];
		int[][] building3 = new int[3][10];
		int[][] building4 = new int[3][10];
		for(int i = 0; i < n; i++) {
			int floor = data[i][1];
			int number = data[i][2];
			if(data[i][0] == 1) {
				building1[floor - 1][number -1] = building1[floor - 1][number -1] + data[i][3];
			}
			if(data[i][0] == 2) {
				building2[floor - 1][number -1] = building2[floor - 1][number -1] + data[i][3];
			}
			if(data[i][0] == 3) {
				building3[floor - 1][number -1] = building3[floor - 1][number -1] + data[i][3];
			}
			if(data[i][0] == 4) {
				building4[floor - 1][number -1] = building4[floor - 1][number -1] + data[i][3];
			}
		}
		
		//?????????????????????
		for(int i = 0; i < 3; i++) {
			for(int j = 0; j < 10; j++) {
				System.out.print(" " + building1[i][j]);
			}
			System.out.println();
		}
		System.out.println("####################");
		
		for(int i = 0; i < 3; i++) {
			for(int j = 0; j < 10; j++) {
				System.out.print(" " + building2[i][j]);
			}
			System.out.println();
		}
		System.out.println("####################");
		
		for(int i = 0; i < 3; i++) {
			for(int j = 0; j < 10; j++) {
				System.out.print(" " + building3[i][j]);
			}
			System.out.println();
		}
		System.out.println("####################");
		
		for(int i = 0; i < 3; i++) {
			for(int j = 0; j < 10; j++) {
				System.out.print(" " + building4[i][j]);
			}
			System.out.println();
		}
	} 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 ArrayList<String> list = new ArrayList<String>(); list new ArrayList<String>() for (int i = 0; i < n; i++) {
			list.add(br.readLine());
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			list.add(br.readLine());
		} {
			list.add(br.readLine());
		} list.add(br.readLine()) list.add list br.readLine() br.readLine br int[][] data = new int[n][4]; data new int[n][4] n 4 for(int i = 0; i < n; i++) {
			String s = list.get(i);
			String [] ary = s.split(" ", 0);
		
			
			for(int j = 0; j < 4; j++) {	
				data[i][j] = Integer.parseInt(ary[j]);
			}
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			String s = list.get(i);
			String [] ary = s.split(" ", 0);
		
			
			for(int j = 0; j < 4; j++) {	
				data[i][j] = Integer.parseInt(ary[j]);
			}
		} {
			String s = list.get(i);
			String [] ary = s.split(" ", 0);
		
			
			for(int j = 0; j < 4; j++) {	
				data[i][j] = Integer.parseInt(ary[j]);
			}
		} String s = list.get(i); s list.get(i) list.get list i String [] ary = s.split(" ", 0); ary s.split(" ", 0) s.split s " " 0 for(int j = 0; j < 4; j++) {	
				data[i][j] = Integer.parseInt(ary[j]);
			} int j = 0; int j = 0; j 0 j < 4 j 4 j++ j++ j {	
				data[i][j] = Integer.parseInt(ary[j]);
			} {	
				data[i][j] = Integer.parseInt(ary[j]);
			} data[i][j] = Integer.parseInt(ary[j]) data[i][j] data[i] data i j Integer.parseInt(ary[j]) Integer.parseInt Integer ary[j] ary j int[][] building1 = new int[3][10]; building1 new int[3][10] 3 10 int[][] building2 = new int[3][10]; building2 new int[3][10] 3 10 int[][] building3 = new int[3][10]; building3 new int[3][10] 3 10 int[][] building4 = new int[3][10]; building4 new int[3][10] 3 10 for(int i = 0; i < n; i++) {
			int floor = data[i][1];
			int number = data[i][2];
			if(data[i][0] == 1) {
				building1[floor - 1][number -1] = building1[floor - 1][number -1] + data[i][3];
			}
			if(data[i][0] == 2) {
				building2[floor - 1][number -1] = building2[floor - 1][number -1] + data[i][3];
			}
			if(data[i][0] == 3) {
				building3[floor - 1][number -1] = building3[floor - 1][number -1] + data[i][3];
			}
			if(data[i][0] == 4) {
				building4[floor - 1][number -1] = building4[floor - 1][number -1] + data[i][3];
			}
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			int floor = data[i][1];
			int number = data[i][2];
			if(data[i][0] == 1) {
				building1[floor - 1][number -1] = building1[floor - 1][number -1] + data[i][3];
			}
			if(data[i][0] == 2) {
				building2[floor - 1][number -1] = building2[floor - 1][number -1] + data[i][3];
			}
			if(data[i][0] == 3) {
				building3[floor - 1][number -1] = building3[floor - 1][number -1] + data[i][3];
			}
			if(data[i][0] == 4) {
				building4[floor - 1][number -1] = building4[floor - 1][number -1] + data[i][3];
			}
		} {
			int floor = data[i][1];
			int number = data[i][2];
			if(data[i][0] == 1) {
				building1[floor - 1][number -1] = building1[floor - 1][number -1] + data[i][3];
			}
			if(data[i][0] == 2) {
				building2[floor - 1][number -1] = building2[floor - 1][number -1] + data[i][3];
			}
			if(data[i][0] == 3) {
				building3[floor - 1][number -1] = building3[floor - 1][number -1] + data[i][3];
			}
			if(data[i][0] == 4) {
				building4[floor - 1][number -1] = building4[floor - 1][number -1] + data[i][3];
			}
		} int floor = data[i][1]; floor data[i][1] data[i] data i 1 int number = data[i][2]; number data[i][2] data[i] data i 2 if(data[i][0] == 1) {
				building1[floor - 1][number -1] = building1[floor - 1][number -1] + data[i][3];
			} data[i][0] == 1 data[i][0] data[i] data i 0 1 {
				building1[floor - 1][number -1] = building1[floor - 1][number -1] + data[i][3];
			} building1[floor - 1][number -1] = building1[floor - 1][number -1] + data[i][3] building1[floor - 1][number -1] building1[floor - 1] building1 floor - 1 floor 1 number -1 number 1 building1[floor - 1][number -1] + data[i][3] building1[floor - 1][number -1] building1[floor - 1] building1 floor - 1 floor 1 number -1 number 1 data[i][3] data[i] data i 3 if(data[i][0] == 2) {
				building2[floor - 1][number -1] = building2[floor - 1][number -1] + data[i][3];
			} data[i][0] == 2 data[i][0] data[i] data i 0 2 {
				building2[floor - 1][number -1] = building2[floor - 1][number -1] + data[i][3];
			} building2[floor - 1][number -1] = building2[floor - 1][number -1] + data[i][3] building2[floor - 1][number -1] building2[floor - 1] building2 floor - 1 floor 1 number -1 number 1 building2[floor - 1][number -1] + data[i][3] building2[floor - 1][number -1] building2[floor - 1] building2 floor - 1 floor 1 number -1 number 1 data[i][3] data[i] data i 3 if(data[i][0] == 3) {
				building3[floor - 1][number -1] = building3[floor - 1][number -1] + data[i][3];
			} data[i][0] == 3 data[i][0] data[i] data i 0 3 {
				building3[floor - 1][number -1] = building3[floor - 1][number -1] + data[i][3];
			} building3[floor - 1][number -1] = building3[floor - 1][number -1] + data[i][3] building3[floor - 1][number -1] building3[floor - 1] building3 floor - 1 floor 1 number -1 number 1 building3[floor - 1][number -1] + data[i][3] building3[floor - 1][number -1] building3[floor - 1] building3 floor - 1 floor 1 number -1 number 1 data[i][3] data[i] data i 3 if(data[i][0] == 4) {
				building4[floor - 1][number -1] = building4[floor - 1][number -1] + data[i][3];
			} data[i][0] == 4 data[i][0] data[i] data i 0 4 {
				building4[floor - 1][number -1] = building4[floor - 1][number -1] + data[i][3];
			} building4[floor - 1][number -1] = building4[floor - 1][number -1] + data[i][3] building4[floor - 1][number -1] building4[floor - 1] building4 floor - 1 floor 1 number -1 number 1 building4[floor - 1][number -1] + data[i][3] building4[floor - 1][number -1] building4[floor - 1] building4 floor - 1 floor 1 number -1 number 1 data[i][3] data[i] data i 3 for(int i = 0; i < 3; i++) {
			for(int j = 0; j < 10; j++) {
				System.out.print(" " + building1[i][j]);
			}
			System.out.println();
		} int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
			for(int j = 0; j < 10; j++) {
				System.out.print(" " + building1[i][j]);
			}
			System.out.println();
		} {
			for(int j = 0; j < 10; j++) {
				System.out.print(" " + building1[i][j]);
			}
			System.out.println();
		} for(int j = 0; j < 10; j++) {
				System.out.print(" " + building1[i][j]);
			} int j = 0; int j = 0; j 0 j < 10 j 10 j++ j++ j {
				System.out.print(" " + building1[i][j]);
			} {
				System.out.print(" " + building1[i][j]);
			} System.out.print(" " + building1[i][j]) System.out.print System.out System System.out " " + building1[i][j] " " building1[i][j] building1[i] building1 i j System.out.println() System.out.println System.out System System.out System.out.println("####################") System.out.println System.out System System.out "####################" for(int i = 0; i < 3; i++) {
			for(int j = 0; j < 10; j++) {
				System.out.print(" " + building2[i][j]);
			}
			System.out.println();
		} int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
			for(int j = 0; j < 10; j++) {
				System.out.print(" " + building2[i][j]);
			}
			System.out.println();
		} {
			for(int j = 0; j < 10; j++) {
				System.out.print(" " + building2[i][j]);
			}
			System.out.println();
		} for(int j = 0; j < 10; j++) {
				System.out.print(" " + building2[i][j]);
			} int j = 0; int j = 0; j 0 j < 10 j 10 j++ j++ j {
				System.out.print(" " + building2[i][j]);
			} {
				System.out.print(" " + building2[i][j]);
			} System.out.print(" " + building2[i][j]) System.out.print System.out System System.out " " + building2[i][j] " " building2[i][j] building2[i] building2 i j System.out.println() System.out.println System.out System System.out System.out.println("####################") System.out.println System.out System System.out "####################" for(int i = 0; i < 3; i++) {
			for(int j = 0; j < 10; j++) {
				System.out.print(" " + building3[i][j]);
			}
			System.out.println();
		} int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
			for(int j = 0; j < 10; j++) {
				System.out.print(" " + building3[i][j]);
			}
			System.out.println();
		} {
			for(int j = 0; j < 10; j++) {
				System.out.print(" " + building3[i][j]);
			}
			System.out.println();
		} for(int j = 0; j < 10; j++) {
				System.out.print(" " + building3[i][j]);
			} int j = 0; int j = 0; j 0 j < 10 j 10 j++ j++ j {
				System.out.print(" " + building3[i][j]);
			} {
				System.out.print(" " + building3[i][j]);
			} System.out.print(" " + building3[i][j]) System.out.print System.out System System.out " " + building3[i][j] " " building3[i][j] building3[i] building3 i j System.out.println() System.out.println System.out System System.out System.out.println("####################") System.out.println System.out System System.out "####################" for(int i = 0; i < 3; i++) {
			for(int j = 0; j < 10; j++) {
				System.out.print(" " + building4[i][j]);
			}
			System.out.println();
		} int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
			for(int j = 0; j < 10; j++) {
				System.out.print(" " + building4[i][j]);
			}
			System.out.println();
		} {
			for(int j = 0; j < 10; j++) {
				System.out.print(" " + building4[i][j]);
			}
			System.out.println();
		} for(int j = 0; j < 10; j++) {
				System.out.print(" " + building4[i][j]);
			} int j = 0; int j = 0; j 0 j < 10 j 10 j++ j++ j {
				System.out.print(" " + building4[i][j]);
			} {
				System.out.print(" " + building4[i][j]);
			} System.out.print(" " + building4[i][j]) System.out.print System.out System System.out " " + building4[i][j] " " building4[i][j] building4[i] building4 i j System.out.println() System.out.println System.out System System.out String[] args args public class Main {

	public static void main(String[] args) throws java.lang.Exception
	{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		//?????±?????°n????¨??????????
		int n = (Integer.parseInt(br.readLine()));
		
		//n??¶????????±????????????
		ArrayList<String> list = new ArrayList<String>();
		for (int i = 0; i < n; i++) {
			list.add(br.readLine());
		}

		
		//?????????????????±???int??????????????????2?¬?????????????????´???????
		int[][] data = new int[n][4];
		for(int i = 0; i < n; i++) {
			String s = list.get(i);
			String [] ary = s.split(" ", 0);
		
			
			for(int j = 0; j < 4; j++) {	
				data[i][j] = Integer.parseInt(ary[j]);
			}
		}
		
		//?????±????????¨?????¨?±??????±????¨??????????
		int[][] building1 = new int[3][10];
		int[][] building2 = new int[3][10];
		int[][] building3 = new int[3][10];
		int[][] building4 = new int[3][10];
		for(int i = 0; i < n; i++) {
			int floor = data[i][1];
			int number = data[i][2];
			if(data[i][0] == 1) {
				building1[floor - 1][number -1] = building1[floor - 1][number -1] + data[i][3];
			}
			if(data[i][0] == 2) {
				building2[floor - 1][number -1] = building2[floor - 1][number -1] + data[i][3];
			}
			if(data[i][0] == 3) {
				building3[floor - 1][number -1] = building3[floor - 1][number -1] + data[i][3];
			}
			if(data[i][0] == 4) {
				building4[floor - 1][number -1] = building4[floor - 1][number -1] + data[i][3];
			}
		}
		
		//?????????????????????
		for(int i = 0; i < 3; i++) {
			for(int j = 0; j < 10; j++) {
				System.out.print(" " + building1[i][j]);
			}
			System.out.println();
		}
		System.out.println("####################");
		
		for(int i = 0; i < 3; i++) {
			for(int j = 0; j < 10; j++) {
				System.out.print(" " + building2[i][j]);
			}
			System.out.println();
		}
		System.out.println("####################");
		
		for(int i = 0; i < 3; i++) {
			for(int j = 0; j < 10; j++) {
				System.out.print(" " + building3[i][j]);
			}
			System.out.println();
		}
		System.out.println("####################");
		
		for(int i = 0; i < 3; i++) {
			for(int j = 0; j < 10; j++) {
				System.out.print(" " + building4[i][j]);
			}
			System.out.println();
		}
	}

} public class Main {

	public static void main(String[] args) throws java.lang.Exception
	{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		//?????±?????°n????¨??????????
		int n = (Integer.parseInt(br.readLine()));
		
		//n??¶????????±????????????
		ArrayList<String> list = new ArrayList<String>();
		for (int i = 0; i < n; i++) {
			list.add(br.readLine());
		}

		
		//?????????????????±???int??????????????????2?¬?????????????????´???????
		int[][] data = new int[n][4];
		for(int i = 0; i < n; i++) {
			String s = list.get(i);
			String [] ary = s.split(" ", 0);
		
			
			for(int j = 0; j < 4; j++) {	
				data[i][j] = Integer.parseInt(ary[j]);
			}
		}
		
		//?????±????????¨?????¨?±??????±????¨??????????
		int[][] building1 = new int[3][10];
		int[][] building2 = new int[3][10];
		int[][] building3 = new int[3][10];
		int[][] building4 = new int[3][10];
		for(int i = 0; i < n; i++) {
			int floor = data[i][1];
			int number = data[i][2];
			if(data[i][0] == 1) {
				building1[floor - 1][number -1] = building1[floor - 1][number -1] + data[i][3];
			}
			if(data[i][0] == 2) {
				building2[floor - 1][number -1] = building2[floor - 1][number -1] + data[i][3];
			}
			if(data[i][0] == 3) {
				building3[floor - 1][number -1] = building3[floor - 1][number -1] + data[i][3];
			}
			if(data[i][0] == 4) {
				building4[floor - 1][number -1] = building4[floor - 1][number -1] + data[i][3];
			}
		}
		
		//?????????????????????
		for(int i = 0; i < 3; i++) {
			for(int j = 0; j < 10; j++) {
				System.out.print(" " + building1[i][j]);
			}
			System.out.println();
		}
		System.out.println("####################");
		
		for(int i = 0; i < 3; i++) {
			for(int j = 0; j < 10; j++) {
				System.out.print(" " + building2[i][j]);
			}
			System.out.println();
		}
		System.out.println("####################");
		
		for(int i = 0; i < 3; i++) {
			for(int j = 0; j < 10; j++) {
				System.out.print(" " + building3[i][j]);
			}
			System.out.println();
		}
		System.out.println("####################");
		
		for(int i = 0; i < 3; i++) {
			for(int j = 0; j < 10; j++) {
				System.out.print(" " + building4[i][j]);
			}
			System.out.println();
		}
	}

} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;

public class Main {

	public static void main(String[] args) throws java.lang.Exception
	{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		//?????±?????°n????¨??????????
		int n = (Integer.parseInt(br.readLine()));
		
		//n??¶????????±????????????
		ArrayList<String> list = new ArrayList<String>();
		for (int i = 0; i < n; i++) {
			list.add(br.readLine());
		}

		
		//?????????????????±???int??????????????????2?¬?????????????????´???????
		int[][] data = new int[n][4];
		for(int i = 0; i < n; i++) {
			String s = list.get(i);
			String [] ary = s.split(" ", 0);
		
			
			for(int j = 0; j < 4; j++) {	
				data[i][j] = Integer.parseInt(ary[j]);
			}
		}
		
		//?????±????????¨?????¨?±??????±????¨??????????
		int[][] building1 = new int[3][10];
		int[][] building2 = new int[3][10];
		int[][] building3 = new int[3][10];
		int[][] building4 = new int[3][10];
		for(int i = 0; i < n; i++) {
			int floor = data[i][1];
			int number = data[i][2];
			if(data[i][0] == 1) {
				building1[floor - 1][number -1] = building1[floor - 1][number -1] + data[i][3];
			}
			if(data[i][0] == 2) {
				building2[floor - 1][number -1] = building2[floor - 1][number -1] + data[i][3];
			}
			if(data[i][0] == 3) {
				building3[floor - 1][number -1] = building3[floor - 1][number -1] + data[i][3];
			}
			if(data[i][0] == 4) {
				building4[floor - 1][number -1] = building4[floor - 1][number -1] + data[i][3];
			}
		}
		
		//?????????????????????
		for(int i = 0; i < 3; i++) {
			for(int j = 0; j < 10; j++) {
				System.out.print(" " + building1[i][j]);
			}
			System.out.println();
		}
		System.out.println("####################");
		
		for(int i = 0; i < 3; i++) {
			for(int j = 0; j < 10; j++) {
				System.out.print(" " + building2[i][j]);
			}
			System.out.println();
		}
		System.out.println("####################");
		
		for(int i = 0; i < 3; i++) {
			for(int j = 0; j < 10; j++) {
				System.out.print(" " + building3[i][j]);
			}
			System.out.println();
		}
		System.out.println("####################");
		
		for(int i = 0; i < 3; i++) {
			for(int j = 0; j < 10; j++) {
				System.out.print(" " + building4[i][j]);
			}
			System.out.println();
		}
	}

}