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

public class Main {
	public void maain(){

	}

	public static void main(String[] args) throws IOException {
		// TODO ?????????????????????????????????????????????
		//???????????£?¨?
		int building [][][] = new int [4][3][10];

		//?????????????????????????????\??????
    	for(int b_building = 0; b_building < 4; b_building++){
    		for(int stairs = 0; stairs < 3; stairs++){
    			for(int num = 0; num < 10; num++){
    				building[b_building][stairs][num] = 0;
    			}
    		}
    	}

		//1???????????\????????¢
		InputStreamReader isr = new InputStreamReader(System.in);
        BufferedReader br = new BufferedReader(isr);

        String[] input = br.readLine().split(" ");
        int n = Integer.parseInt(input[0]);

        //v??????????????\??????
        for(int set = 0;set < n; set++){
        	String[] input2 = br.readLine().split(" ");
        		int b = Integer.parseInt(input2[0]);
        		int f = Integer.parseInt(input2[1]);
        		int r = Integer.parseInt(input2[2]);
        		int v = Integer.parseInt(input2[3]);
        		building[b - 1][f - 1][r - 1] = building[b - 1][f - 1][r - 1] + v;
        }

		//?????¢?????¨?????????
    	for(int b_building = 0; b_building < 4; b_building++){
    		for(int stairs = 0; stairs < 3; stairs++){
    			for(int num = 0; num < 10; num++){
    				System.out.print(" ");
    				System.out.print(building[b_building][stairs][num]);
    			}
    			System.out.println();
    		}
    		if(b_building == 3){
    		}else{
    			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 void maain(){

	}

	public static void main(String[] args) throws IOException {
		// TODO ?????????????????????????????????????????????
		//???????????£?¨?
		int building [][][] = new int [4][3][10];

		//?????????????????????????????\??????
    	for(int b_building = 0; b_building < 4; b_building++){
    		for(int stairs = 0; stairs < 3; stairs++){
    			for(int num = 0; num < 10; num++){
    				building[b_building][stairs][num] = 0;
    			}
    		}
    	}

		//1???????????\????????¢
		InputStreamReader isr = new InputStreamReader(System.in);
        BufferedReader br = new BufferedReader(isr);

        String[] input = br.readLine().split(" ");
        int n = Integer.parseInt(input[0]);

        //v??????????????\??????
        for(int set = 0;set < n; set++){
        	String[] input2 = br.readLine().split(" ");
        		int b = Integer.parseInt(input2[0]);
        		int f = Integer.parseInt(input2[1]);
        		int r = Integer.parseInt(input2[2]);
        		int v = Integer.parseInt(input2[3]);
        		building[b - 1][f - 1][r - 1] = building[b - 1][f - 1][r - 1] + v;
        }

		//?????¢?????¨?????????
    	for(int b_building = 0; b_building < 4; b_building++){
    		for(int stairs = 0; stairs < 3; stairs++){
    			for(int num = 0; num < 10; num++){
    				System.out.print(" ");
    				System.out.print(building[b_building][stairs][num]);
    			}
    			System.out.println();
    		}
    		if(b_building == 3){
    		}else{
    			System.out.println("####################");
    		}
    	}
	}
} Main public void maain(){

	} maain {

	} public static void main(String[] args) throws IOException {
		// TODO ?????????????????????????????????????????????
		//???????????£?¨?
		int building [][][] = new int [4][3][10];

		//?????????????????????????????\??????
    	for(int b_building = 0; b_building < 4; b_building++){
    		for(int stairs = 0; stairs < 3; stairs++){
    			for(int num = 0; num < 10; num++){
    				building[b_building][stairs][num] = 0;
    			}
    		}
    	}

		//1???????????\????????¢
		InputStreamReader isr = new InputStreamReader(System.in);
        BufferedReader br = new BufferedReader(isr);

        String[] input = br.readLine().split(" ");
        int n = Integer.parseInt(input[0]);

        //v??????????????\??????
        for(int set = 0;set < n; set++){
        	String[] input2 = br.readLine().split(" ");
        		int b = Integer.parseInt(input2[0]);
        		int f = Integer.parseInt(input2[1]);
        		int r = Integer.parseInt(input2[2]);
        		int v = Integer.parseInt(input2[3]);
        		building[b - 1][f - 1][r - 1] = building[b - 1][f - 1][r - 1] + v;
        }

		//?????¢?????¨?????????
    	for(int b_building = 0; b_building < 4; b_building++){
    		for(int stairs = 0; stairs < 3; stairs++){
    			for(int num = 0; num < 10; num++){
    				System.out.print(" ");
    				System.out.print(building[b_building][stairs][num]);
    			}
    			System.out.println();
    		}
    		if(b_building == 3){
    		}else{
    			System.out.println("####################");
    		}
    	}
	} main {
		// TODO ?????????????????????????????????????????????
		//???????????£?¨?
		int building [][][] = new int [4][3][10];

		//?????????????????????????????\??????
    	for(int b_building = 0; b_building < 4; b_building++){
    		for(int stairs = 0; stairs < 3; stairs++){
    			for(int num = 0; num < 10; num++){
    				building[b_building][stairs][num] = 0;
    			}
    		}
    	}

		//1???????????\????????¢
		InputStreamReader isr = new InputStreamReader(System.in);
        BufferedReader br = new BufferedReader(isr);

        String[] input = br.readLine().split(" ");
        int n = Integer.parseInt(input[0]);

        //v??????????????\??????
        for(int set = 0;set < n; set++){
        	String[] input2 = br.readLine().split(" ");
        		int b = Integer.parseInt(input2[0]);
        		int f = Integer.parseInt(input2[1]);
        		int r = Integer.parseInt(input2[2]);
        		int v = Integer.parseInt(input2[3]);
        		building[b - 1][f - 1][r - 1] = building[b - 1][f - 1][r - 1] + v;
        }

		//?????¢?????¨?????????
    	for(int b_building = 0; b_building < 4; b_building++){
    		for(int stairs = 0; stairs < 3; stairs++){
    			for(int num = 0; num < 10; num++){
    				System.out.print(" ");
    				System.out.print(building[b_building][stairs][num]);
    			}
    			System.out.println();
    		}
    		if(b_building == 3){
    		}else{
    			System.out.println("####################");
    		}
    	}
	} int building [][][] = new int [4][3][10]; building new int [4][3][10] 4 3 10 for(int b_building = 0; b_building < 4; b_building++){
    		for(int stairs = 0; stairs < 3; stairs++){
    			for(int num = 0; num < 10; num++){
    				building[b_building][stairs][num] = 0;
    			}
    		}
    	} int b_building = 0; int b_building = 0; b_building 0 b_building < 4 b_building 4 b_building++ b_building++ b_building {
    		for(int stairs = 0; stairs < 3; stairs++){
    			for(int num = 0; num < 10; num++){
    				building[b_building][stairs][num] = 0;
    			}
    		}
    	} {
    		for(int stairs = 0; stairs < 3; stairs++){
    			for(int num = 0; num < 10; num++){
    				building[b_building][stairs][num] = 0;
    			}
    		}
    	} for(int stairs = 0; stairs < 3; stairs++){
    			for(int num = 0; num < 10; num++){
    				building[b_building][stairs][num] = 0;
    			}
    		} int stairs = 0; int stairs = 0; stairs 0 stairs < 3 stairs 3 stairs++ stairs++ stairs {
    			for(int num = 0; num < 10; num++){
    				building[b_building][stairs][num] = 0;
    			}
    		} {
    			for(int num = 0; num < 10; num++){
    				building[b_building][stairs][num] = 0;
    			}
    		} for(int num = 0; num < 10; num++){
    				building[b_building][stairs][num] = 0;
    			} int num = 0; int num = 0; num 0 num < 10 num 10 num++ num++ num {
    				building[b_building][stairs][num] = 0;
    			} {
    				building[b_building][stairs][num] = 0;
    			} building[b_building][stairs][num] = 0 building[b_building][stairs][num] building[b_building][stairs] building[b_building] building b_building stairs num 0 InputStreamReader isr = new InputStreamReader(System.in); isr new InputStreamReader(System.in) BufferedReader br = new BufferedReader(isr); br new BufferedReader(isr) String[] input = br.readLine().split(" "); input br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " int n = Integer.parseInt(input[0]); n Integer.parseInt(input[0]) Integer.parseInt Integer input[0] input 0 for(int set = 0;set < n; set++){
        	String[] input2 = br.readLine().split(" ");
        		int b = Integer.parseInt(input2[0]);
        		int f = Integer.parseInt(input2[1]);
        		int r = Integer.parseInt(input2[2]);
        		int v = Integer.parseInt(input2[3]);
        		building[b - 1][f - 1][r - 1] = building[b - 1][f - 1][r - 1] + v;
        } int set = 0; int set = 0; set 0 set < n set n set++ set++ set {
        	String[] input2 = br.readLine().split(" ");
        		int b = Integer.parseInt(input2[0]);
        		int f = Integer.parseInt(input2[1]);
        		int r = Integer.parseInt(input2[2]);
        		int v = Integer.parseInt(input2[3]);
        		building[b - 1][f - 1][r - 1] = building[b - 1][f - 1][r - 1] + v;
        } {
        	String[] input2 = br.readLine().split(" ");
        		int b = Integer.parseInt(input2[0]);
        		int f = Integer.parseInt(input2[1]);
        		int r = Integer.parseInt(input2[2]);
        		int v = Integer.parseInt(input2[3]);
        		building[b - 1][f - 1][r - 1] = building[b - 1][f - 1][r - 1] + v;
        } String[] input2 = br.readLine().split(" "); input2 br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " int b = Integer.parseInt(input2[0]); b Integer.parseInt(input2[0]) Integer.parseInt Integer input2[0] input2 0 int f = Integer.parseInt(input2[1]); f Integer.parseInt(input2[1]) Integer.parseInt Integer input2[1] input2 1 int r = Integer.parseInt(input2[2]); r Integer.parseInt(input2[2]) Integer.parseInt Integer input2[2] input2 2 int v = Integer.parseInt(input2[3]); v Integer.parseInt(input2[3]) Integer.parseInt Integer input2[3] input2 3 building[b - 1][f - 1][r - 1] = building[b - 1][f - 1][r - 1] + v building[b - 1][f - 1][r - 1] building[b - 1][f - 1] building[b - 1] building b - 1 b 1 f - 1 f 1 r - 1 r 1 building[b - 1][f - 1][r - 1] + v building[b - 1][f - 1][r - 1] building[b - 1][f - 1] building[b - 1] building b - 1 b 1 f - 1 f 1 r - 1 r 1 v for(int b_building = 0; b_building < 4; b_building++){
    		for(int stairs = 0; stairs < 3; stairs++){
    			for(int num = 0; num < 10; num++){
    				System.out.print(" ");
    				System.out.print(building[b_building][stairs][num]);
    			}
    			System.out.println();
    		}
    		if(b_building == 3){
    		}else{
    			System.out.println("####################");
    		}
    	} int b_building = 0; int b_building = 0; b_building 0 b_building < 4 b_building 4 b_building++ b_building++ b_building {
    		for(int stairs = 0; stairs < 3; stairs++){
    			for(int num = 0; num < 10; num++){
    				System.out.print(" ");
    				System.out.print(building[b_building][stairs][num]);
    			}
    			System.out.println();
    		}
    		if(b_building == 3){
    		}else{
    			System.out.println("####################");
    		}
    	} {
    		for(int stairs = 0; stairs < 3; stairs++){
    			for(int num = 0; num < 10; num++){
    				System.out.print(" ");
    				System.out.print(building[b_building][stairs][num]);
    			}
    			System.out.println();
    		}
    		if(b_building == 3){
    		}else{
    			System.out.println("####################");
    		}
    	} for(int stairs = 0; stairs < 3; stairs++){
    			for(int num = 0; num < 10; num++){
    				System.out.print(" ");
    				System.out.print(building[b_building][stairs][num]);
    			}
    			System.out.println();
    		} int stairs = 0; int stairs = 0; stairs 0 stairs < 3 stairs 3 stairs++ stairs++ stairs {
    			for(int num = 0; num < 10; num++){
    				System.out.print(" ");
    				System.out.print(building[b_building][stairs][num]);
    			}
    			System.out.println();
    		} {
    			for(int num = 0; num < 10; num++){
    				System.out.print(" ");
    				System.out.print(building[b_building][stairs][num]);
    			}
    			System.out.println();
    		} for(int num = 0; num < 10; num++){
    				System.out.print(" ");
    				System.out.print(building[b_building][stairs][num]);
    			} int num = 0; int num = 0; num 0 num < 10 num 10 num++ num++ num {
    				System.out.print(" ");
    				System.out.print(building[b_building][stairs][num]);
    			} {
    				System.out.print(" ");
    				System.out.print(building[b_building][stairs][num]);
    			} System.out.print(" ") System.out.print System.out System System.out " " System.out.print(building[b_building][stairs][num]) System.out.print System.out System System.out building[b_building][stairs][num] building[b_building][stairs] building[b_building] building b_building stairs num System.out.println() System.out.println System.out System System.out if(b_building == 3){
    		}else{
    			System.out.println("####################");
    		} b_building == 3 b_building 3 {
    		} {
    			System.out.println("####################");
    		} System.out.println("####################") System.out.println System.out System System.out "####################" String[] args args public class Main {
	public void maain(){

	}

	public static void main(String[] args) throws IOException {
		// TODO ?????????????????????????????????????????????
		//???????????£?¨?
		int building [][][] = new int [4][3][10];

		//?????????????????????????????\??????
    	for(int b_building = 0; b_building < 4; b_building++){
    		for(int stairs = 0; stairs < 3; stairs++){
    			for(int num = 0; num < 10; num++){
    				building[b_building][stairs][num] = 0;
    			}
    		}
    	}

		//1???????????\????????¢
		InputStreamReader isr = new InputStreamReader(System.in);
        BufferedReader br = new BufferedReader(isr);

        String[] input = br.readLine().split(" ");
        int n = Integer.parseInt(input[0]);

        //v??????????????\??????
        for(int set = 0;set < n; set++){
        	String[] input2 = br.readLine().split(" ");
        		int b = Integer.parseInt(input2[0]);
        		int f = Integer.parseInt(input2[1]);
        		int r = Integer.parseInt(input2[2]);
        		int v = Integer.parseInt(input2[3]);
        		building[b - 1][f - 1][r - 1] = building[b - 1][f - 1][r - 1] + v;
        }

		//?????¢?????¨?????????
    	for(int b_building = 0; b_building < 4; b_building++){
    		for(int stairs = 0; stairs < 3; stairs++){
    			for(int num = 0; num < 10; num++){
    				System.out.print(" ");
    				System.out.print(building[b_building][stairs][num]);
    			}
    			System.out.println();
    		}
    		if(b_building == 3){
    		}else{
    			System.out.println("####################");
    		}
    	}
	}
} public class Main {
	public void maain(){

	}

	public static void main(String[] args) throws IOException {
		// TODO ?????????????????????????????????????????????
		//???????????£?¨?
		int building [][][] = new int [4][3][10];

		//?????????????????????????????\??????
    	for(int b_building = 0; b_building < 4; b_building++){
    		for(int stairs = 0; stairs < 3; stairs++){
    			for(int num = 0; num < 10; num++){
    				building[b_building][stairs][num] = 0;
    			}
    		}
    	}

		//1???????????\????????¢
		InputStreamReader isr = new InputStreamReader(System.in);
        BufferedReader br = new BufferedReader(isr);

        String[] input = br.readLine().split(" ");
        int n = Integer.parseInt(input[0]);

        //v??????????????\??????
        for(int set = 0;set < n; set++){
        	String[] input2 = br.readLine().split(" ");
        		int b = Integer.parseInt(input2[0]);
        		int f = Integer.parseInt(input2[1]);
        		int r = Integer.parseInt(input2[2]);
        		int v = Integer.parseInt(input2[3]);
        		building[b - 1][f - 1][r - 1] = building[b - 1][f - 1][r - 1] + v;
        }

		//?????¢?????¨?????????
    	for(int b_building = 0; b_building < 4; b_building++){
    		for(int stairs = 0; stairs < 3; stairs++){
    			for(int num = 0; num < 10; num++){
    				System.out.print(" ");
    				System.out.print(building[b_building][stairs][num]);
    			}
    			System.out.println();
    		}
    		if(b_building == 3){
    		}else{
    			System.out.println("####################");
    		}
    	}
	}
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
	public void maain(){

	}

	public static void main(String[] args) throws IOException {
		// TODO ?????????????????????????????????????????????
		//???????????£?¨?
		int building [][][] = new int [4][3][10];

		//?????????????????????????????\??????
    	for(int b_building = 0; b_building < 4; b_building++){
    		for(int stairs = 0; stairs < 3; stairs++){
    			for(int num = 0; num < 10; num++){
    				building[b_building][stairs][num] = 0;
    			}
    		}
    	}

		//1???????????\????????¢
		InputStreamReader isr = new InputStreamReader(System.in);
        BufferedReader br = new BufferedReader(isr);

        String[] input = br.readLine().split(" ");
        int n = Integer.parseInt(input[0]);

        //v??????????????\??????
        for(int set = 0;set < n; set++){
        	String[] input2 = br.readLine().split(" ");
        		int b = Integer.parseInt(input2[0]);
        		int f = Integer.parseInt(input2[1]);
        		int r = Integer.parseInt(input2[2]);
        		int v = Integer.parseInt(input2[3]);
        		building[b - 1][f - 1][r - 1] = building[b - 1][f - 1][r - 1] + v;
        }

		//?????¢?????¨?????????
    	for(int b_building = 0; b_building < 4; b_building++){
    		for(int stairs = 0; stairs < 3; stairs++){
    			for(int num = 0; num < 10; num++){
    				System.out.print(" ");
    				System.out.print(building[b_building][stairs][num]);
    			}
    			System.out.println();
    		}
    		if(b_building == 3){
    		}else{
    			System.out.println("####################");
    		}
    	}
	}
}