import java.io.ByteArrayInputStream;
import java.io.PrintWriter;
import java.util.Scanner;

public class Main {

    String INPUT = "";

    public static void main(String[] args) throws Exception {
        new Main().run();
    }

    void run() {
        Scanner sc = INPUT.isEmpty() ? new Scanner(System.in) : new Scanner(new ByteArrayInputStream(INPUT.getBytes()));
        PrintWriter out = new PrintWriter(System.out);

        solve(sc, out);
        out.flush();
    }

    void solve(Scanner sc, PrintWriter out) {
        int flg[][][] = 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++) {
					flg[i][j][k] = 0;
				}
			}
		}
    	
    	int n = sc.nextInt();
        
        for (int i = 0; i < n; i++) {
        	int b,f,r,v;
        	b = sc.nextInt();
        	f = sc.nextInt();
        	r = sc.nextInt();
        	v = sc.nextInt();
        	flg[b-1][f-1][r-1] += v;
		}
		for (int i = 0; i < 4; i++) {
			for (int j = 0; j < 3; j++) {
				for (int k = 0; k < 10; k++) {
					System.out.print(" " + flg[i][j][k]);
				}
				System.out.println();
			}
			if (i != 3) {
				System.out.println("####################");
			}
		}
    }
}
 import java.io.ByteArrayInputStream; ByteArrayInputStream java.io import java.io.PrintWriter; PrintWriter java.io import java.util.Scanner; Scanner java.util public class Main {

    String INPUT = "";

    public static void main(String[] args) throws Exception {
        new Main().run();
    }

    void run() {
        Scanner sc = INPUT.isEmpty() ? new Scanner(System.in) : new Scanner(new ByteArrayInputStream(INPUT.getBytes()));
        PrintWriter out = new PrintWriter(System.out);

        solve(sc, out);
        out.flush();
    }

    void solve(Scanner sc, PrintWriter out) {
        int flg[][][] = 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++) {
					flg[i][j][k] = 0;
				}
			}
		}
    	
    	int n = sc.nextInt();
        
        for (int i = 0; i < n; i++) {
        	int b,f,r,v;
        	b = sc.nextInt();
        	f = sc.nextInt();
        	r = sc.nextInt();
        	v = sc.nextInt();
        	flg[b-1][f-1][r-1] += v;
		}
		for (int i = 0; i < 4; i++) {
			for (int j = 0; j < 3; j++) {
				for (int k = 0; k < 10; k++) {
					System.out.print(" " + flg[i][j][k]);
				}
				System.out.println();
			}
			if (i != 3) {
				System.out.println("####################");
			}
		}
    }
} Main String INPUT = ""; INPUT "" public static void main(String[] args) throws Exception {
        new Main().run();
    } main {
        new Main().run();
    } new Main().run() new Main().run new Main() String[] args args void run() {
        Scanner sc = INPUT.isEmpty() ? new Scanner(System.in) : new Scanner(new ByteArrayInputStream(INPUT.getBytes()));
        PrintWriter out = new PrintWriter(System.out);

        solve(sc, out);
        out.flush();
    } run {
        Scanner sc = INPUT.isEmpty() ? new Scanner(System.in) : new Scanner(new ByteArrayInputStream(INPUT.getBytes()));
        PrintWriter out = new PrintWriter(System.out);

        solve(sc, out);
        out.flush();
    } Scanner sc = INPUT.isEmpty() ? new Scanner(System.in) : new Scanner(new ByteArrayInputStream(INPUT.getBytes())); sc INPUT.isEmpty() ? new Scanner(System.in) : new Scanner(new ByteArrayInputStream(INPUT.getBytes())) INPUT.isEmpty() INPUT.isEmpty INPUT new Scanner(System.in) new Scanner(new ByteArrayInputStream(INPUT.getBytes())) PrintWriter out = new PrintWriter(System.out); out new PrintWriter(System.out) solve(sc, out) solve sc out out.flush() out.flush out void solve(Scanner sc, PrintWriter out) {
        int flg[][][] = 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++) {
					flg[i][j][k] = 0;
				}
			}
		}
    	
    	int n = sc.nextInt();
        
        for (int i = 0; i < n; i++) {
        	int b,f,r,v;
        	b = sc.nextInt();
        	f = sc.nextInt();
        	r = sc.nextInt();
        	v = sc.nextInt();
        	flg[b-1][f-1][r-1] += v;
		}
		for (int i = 0; i < 4; i++) {
			for (int j = 0; j < 3; j++) {
				for (int k = 0; k < 10; k++) {
					System.out.print(" " + flg[i][j][k]);
				}
				System.out.println();
			}
			if (i != 3) {
				System.out.println("####################");
			}
		}
    } solve {
        int flg[][][] = 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++) {
					flg[i][j][k] = 0;
				}
			}
		}
    	
    	int n = sc.nextInt();
        
        for (int i = 0; i < n; i++) {
        	int b,f,r,v;
        	b = sc.nextInt();
        	f = sc.nextInt();
        	r = sc.nextInt();
        	v = sc.nextInt();
        	flg[b-1][f-1][r-1] += v;
		}
		for (int i = 0; i < 4; i++) {
			for (int j = 0; j < 3; j++) {
				for (int k = 0; k < 10; k++) {
					System.out.print(" " + flg[i][j][k]);
				}
				System.out.println();
			}
			if (i != 3) {
				System.out.println("####################");
			}
		}
    } int flg[][][] = new int[4][3][10]; flg 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++) {
					flg[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++) {
					flg[i][j][k] = 0;
				}
			}
		} {
			for (int j = 0; j < 3; j++) {
				for (int k = 0; k < 10; k++) {
					flg[i][j][k] = 0;
				}
			}
		} for (int j = 0; j < 3; j++) {
				for (int k = 0; k < 10; k++) {
					flg[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++) {
					flg[i][j][k] = 0;
				}
			} {
				for (int k = 0; k < 10; k++) {
					flg[i][j][k] = 0;
				}
			} for (int k = 0; k < 10; k++) {
					flg[i][j][k] = 0;
				} int k = 0; int k = 0; k 0 k < 10 k 10 k++ k++ k {
					flg[i][j][k] = 0;
				} {
					flg[i][j][k] = 0;
				} flg[i][j][k] = 0 flg[i][j][k] flg[i][j] flg[i] flg i j k 0 int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc for (int i = 0; i < n; i++) {
        	int b,f,r,v;
        	b = sc.nextInt();
        	f = sc.nextInt();
        	r = sc.nextInt();
        	v = sc.nextInt();
        	flg[b-1][f-1][r-1] += v;
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
        	int b,f,r,v;
        	b = sc.nextInt();
        	f = sc.nextInt();
        	r = sc.nextInt();
        	v = sc.nextInt();
        	flg[b-1][f-1][r-1] += v;
		} {
        	int b,f,r,v;
        	b = sc.nextInt();
        	f = sc.nextInt();
        	r = sc.nextInt();
        	v = sc.nextInt();
        	flg[b-1][f-1][r-1] += v;
		} int b b f f r r v; v b = sc.nextInt() b sc.nextInt() sc.nextInt sc f = sc.nextInt() f sc.nextInt() sc.nextInt sc r = sc.nextInt() r sc.nextInt() sc.nextInt sc v = sc.nextInt() v sc.nextInt() sc.nextInt sc flg[b-1][f-1][r-1] += v flg[b-1][f-1][r-1] flg[b-1][f-1] flg[b-1] flg b-1 b 1 f-1 f 1 r-1 r 1 v for (int i = 0; i < 4; i++) {
			for (int j = 0; j < 3; j++) {
				for (int k = 0; k < 10; k++) {
					System.out.print(" " + flg[i][j][k]);
				}
				System.out.println();
			}
			if (i != 3) {
				System.out.println("####################");
			}
		} 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++) {
					System.out.print(" " + flg[i][j][k]);
				}
				System.out.println();
			}
			if (i != 3) {
				System.out.println("####################");
			}
		} {
			for (int j = 0; j < 3; j++) {
				for (int k = 0; k < 10; k++) {
					System.out.print(" " + flg[i][j][k]);
				}
				System.out.println();
			}
			if (i != 3) {
				System.out.println("####################");
			}
		} for (int j = 0; j < 3; j++) {
				for (int k = 0; k < 10; k++) {
					System.out.print(" " + flg[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(" " + flg[i][j][k]);
				}
				System.out.println();
			} {
				for (int k = 0; k < 10; k++) {
					System.out.print(" " + flg[i][j][k]);
				}
				System.out.println();
			} for (int k = 0; k < 10; k++) {
					System.out.print(" " + flg[i][j][k]);
				} int k = 0; int k = 0; k 0 k < 10 k 10 k++ k++ k {
					System.out.print(" " + flg[i][j][k]);
				} {
					System.out.print(" " + flg[i][j][k]);
				} System.out.print(" " + flg[i][j][k]) System.out.print System.out System System.out " " + flg[i][j][k] " " flg[i][j][k] flg[i][j] flg[i] flg i j k System.out.println() System.out.println System.out System System.out if (i != 3) {
				System.out.println("####################");
			} i != 3 i 3 {
				System.out.println("####################");
			} System.out.println("####################") System.out.println System.out System System.out "####################" Scanner sc sc PrintWriter out out public class Main {

    String INPUT = "";

    public static void main(String[] args) throws Exception {
        new Main().run();
    }

    void run() {
        Scanner sc = INPUT.isEmpty() ? new Scanner(System.in) : new Scanner(new ByteArrayInputStream(INPUT.getBytes()));
        PrintWriter out = new PrintWriter(System.out);

        solve(sc, out);
        out.flush();
    }

    void solve(Scanner sc, PrintWriter out) {
        int flg[][][] = 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++) {
					flg[i][j][k] = 0;
				}
			}
		}
    	
    	int n = sc.nextInt();
        
        for (int i = 0; i < n; i++) {
        	int b,f,r,v;
        	b = sc.nextInt();
        	f = sc.nextInt();
        	r = sc.nextInt();
        	v = sc.nextInt();
        	flg[b-1][f-1][r-1] += v;
		}
		for (int i = 0; i < 4; i++) {
			for (int j = 0; j < 3; j++) {
				for (int k = 0; k < 10; k++) {
					System.out.print(" " + flg[i][j][k]);
				}
				System.out.println();
			}
			if (i != 3) {
				System.out.println("####################");
			}
		}
    }
} public class Main {

    String INPUT = "";

    public static void main(String[] args) throws Exception {
        new Main().run();
    }

    void run() {
        Scanner sc = INPUT.isEmpty() ? new Scanner(System.in) : new Scanner(new ByteArrayInputStream(INPUT.getBytes()));
        PrintWriter out = new PrintWriter(System.out);

        solve(sc, out);
        out.flush();
    }

    void solve(Scanner sc, PrintWriter out) {
        int flg[][][] = 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++) {
					flg[i][j][k] = 0;
				}
			}
		}
    	
    	int n = sc.nextInt();
        
        for (int i = 0; i < n; i++) {
        	int b,f,r,v;
        	b = sc.nextInt();
        	f = sc.nextInt();
        	r = sc.nextInt();
        	v = sc.nextInt();
        	flg[b-1][f-1][r-1] += v;
		}
		for (int i = 0; i < 4; i++) {
			for (int j = 0; j < 3; j++) {
				for (int k = 0; k < 10; k++) {
					System.out.print(" " + flg[i][j][k]);
				}
				System.out.println();
			}
			if (i != 3) {
				System.out.println("####################");
			}
		}
    }
} Main
import java.io.ByteArrayInputStream;
import java.io.PrintWriter;
import java.util.Scanner;

public class Main {

    String INPUT = "";

    public static void main(String[] args) throws Exception {
        new Main().run();
    }

    void run() {
        Scanner sc = INPUT.isEmpty() ? new Scanner(System.in) : new Scanner(new ByteArrayInputStream(INPUT.getBytes()));
        PrintWriter out = new PrintWriter(System.out);

        solve(sc, out);
        out.flush();
    }

    void solve(Scanner sc, PrintWriter out) {
        int flg[][][] = 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++) {
					flg[i][j][k] = 0;
				}
			}
		}
    	
    	int n = sc.nextInt();
        
        for (int i = 0; i < n; i++) {
        	int b,f,r,v;
        	b = sc.nextInt();
        	f = sc.nextInt();
        	r = sc.nextInt();
        	v = sc.nextInt();
        	flg[b-1][f-1][r-1] += v;
		}
		for (int i = 0; i < 4; i++) {
			for (int j = 0; j < 3; j++) {
				for (int k = 0; k < 10; k++) {
					System.out.print(" " + flg[i][j][k]);
				}
				System.out.println();
			}
			if (i != 3) {
				System.out.println("####################");
			}
		}
    }
}

