import java.io.*;
import java.lang.StringBuilder;
public class Main {
	public static void main(String[] args) throws Exception{
		BufferedReader sc = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder bu = new StringBuilder();
		int[][][] t = new int[4][3][10];
		int n = Integer.parseInt(sc.readLine());
		for(int i=0;i<n;i++){
			String[] st= sc.readLine().split(" ");
			int b = Integer.parseInt(st[0]);
			int f = Integer.parseInt(st[1]);
			int r = Integer.parseInt(st[2]);
			int v = Integer.parseInt(st[3]);
			t[b-1][f-1][r-1] += v;
		}
		for(int b = 0;b < 4;b++){
			for(int f = 0;f < 3;f++){
				for(int r = 0;r < 10;r++){
					bu.append(" ").append(t[b][f][r]);
				}
				bu.append("\n");
			}
			bu.append("####################\n");
		}
		bu.delete(bu.lastIndexOf("#")-20,bu.lastIndexOf("\n"));
		System.out.print(bu);
	}
} import java.io.*; io.* java import java.lang.StringBuilder; StringBuilder java.lang public class Main {
	public static void main(String[] args) throws Exception{
		BufferedReader sc = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder bu = new StringBuilder();
		int[][][] t = new int[4][3][10];
		int n = Integer.parseInt(sc.readLine());
		for(int i=0;i<n;i++){
			String[] st= sc.readLine().split(" ");
			int b = Integer.parseInt(st[0]);
			int f = Integer.parseInt(st[1]);
			int r = Integer.parseInt(st[2]);
			int v = Integer.parseInt(st[3]);
			t[b-1][f-1][r-1] += v;
		}
		for(int b = 0;b < 4;b++){
			for(int f = 0;f < 3;f++){
				for(int r = 0;r < 10;r++){
					bu.append(" ").append(t[b][f][r]);
				}
				bu.append("\n");
			}
			bu.append("####################\n");
		}
		bu.delete(bu.lastIndexOf("#")-20,bu.lastIndexOf("\n"));
		System.out.print(bu);
	}
} Main public static void main(String[] args) throws Exception{
		BufferedReader sc = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder bu = new StringBuilder();
		int[][][] t = new int[4][3][10];
		int n = Integer.parseInt(sc.readLine());
		for(int i=0;i<n;i++){
			String[] st= sc.readLine().split(" ");
			int b = Integer.parseInt(st[0]);
			int f = Integer.parseInt(st[1]);
			int r = Integer.parseInt(st[2]);
			int v = Integer.parseInt(st[3]);
			t[b-1][f-1][r-1] += v;
		}
		for(int b = 0;b < 4;b++){
			for(int f = 0;f < 3;f++){
				for(int r = 0;r < 10;r++){
					bu.append(" ").append(t[b][f][r]);
				}
				bu.append("\n");
			}
			bu.append("####################\n");
		}
		bu.delete(bu.lastIndexOf("#")-20,bu.lastIndexOf("\n"));
		System.out.print(bu);
	} main {
		BufferedReader sc = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder bu = new StringBuilder();
		int[][][] t = new int[4][3][10];
		int n = Integer.parseInt(sc.readLine());
		for(int i=0;i<n;i++){
			String[] st= sc.readLine().split(" ");
			int b = Integer.parseInt(st[0]);
			int f = Integer.parseInt(st[1]);
			int r = Integer.parseInt(st[2]);
			int v = Integer.parseInt(st[3]);
			t[b-1][f-1][r-1] += v;
		}
		for(int b = 0;b < 4;b++){
			for(int f = 0;f < 3;f++){
				for(int r = 0;r < 10;r++){
					bu.append(" ").append(t[b][f][r]);
				}
				bu.append("\n");
			}
			bu.append("####################\n");
		}
		bu.delete(bu.lastIndexOf("#")-20,bu.lastIndexOf("\n"));
		System.out.print(bu);
	} BufferedReader sc = new BufferedReader(new InputStreamReader(System.in)); sc new BufferedReader(new InputStreamReader(System.in)) StringBuilder bu = new StringBuilder(); bu new StringBuilder() int[][][] t = new int[4][3][10]; t new int[4][3][10] 4 3 10 int n = Integer.parseInt(sc.readLine()); n Integer.parseInt(sc.readLine()) Integer.parseInt Integer sc.readLine() sc.readLine sc for(int i=0;i<n;i++){
			String[] st= sc.readLine().split(" ");
			int b = Integer.parseInt(st[0]);
			int f = Integer.parseInt(st[1]);
			int r = Integer.parseInt(st[2]);
			int v = Integer.parseInt(st[3]);
			t[b-1][f-1][r-1] += v;
		} int i=0; int i=0; i 0 i<n i n i++ i++ i {
			String[] st= sc.readLine().split(" ");
			int b = Integer.parseInt(st[0]);
			int f = Integer.parseInt(st[1]);
			int r = Integer.parseInt(st[2]);
			int v = Integer.parseInt(st[3]);
			t[b-1][f-1][r-1] += v;
		} {
			String[] st= sc.readLine().split(" ");
			int b = Integer.parseInt(st[0]);
			int f = Integer.parseInt(st[1]);
			int r = Integer.parseInt(st[2]);
			int v = Integer.parseInt(st[3]);
			t[b-1][f-1][r-1] += v;
		} String[] st= sc.readLine().split(" "); st sc.readLine().split(" ") sc.readLine().split sc.readLine() sc.readLine sc " " int b = Integer.parseInt(st[0]); b Integer.parseInt(st[0]) Integer.parseInt Integer st[0] st 0 int f = Integer.parseInt(st[1]); f Integer.parseInt(st[1]) Integer.parseInt Integer st[1] st 1 int r = Integer.parseInt(st[2]); r Integer.parseInt(st[2]) Integer.parseInt Integer st[2] st 2 int v = Integer.parseInt(st[3]); v Integer.parseInt(st[3]) Integer.parseInt Integer st[3] st 3 t[b-1][f-1][r-1] += v t[b-1][f-1][r-1] t[b-1][f-1] t[b-1] t b-1 b 1 f-1 f 1 r-1 r 1 v for(int b = 0;b < 4;b++){
			for(int f = 0;f < 3;f++){
				for(int r = 0;r < 10;r++){
					bu.append(" ").append(t[b][f][r]);
				}
				bu.append("\n");
			}
			bu.append("####################\n");
		} int b = 0; int b = 0; b 0 b < 4 b 4 b++ b++ b {
			for(int f = 0;f < 3;f++){
				for(int r = 0;r < 10;r++){
					bu.append(" ").append(t[b][f][r]);
				}
				bu.append("\n");
			}
			bu.append("####################\n");
		} {
			for(int f = 0;f < 3;f++){
				for(int r = 0;r < 10;r++){
					bu.append(" ").append(t[b][f][r]);
				}
				bu.append("\n");
			}
			bu.append("####################\n");
		} for(int f = 0;f < 3;f++){
				for(int r = 0;r < 10;r++){
					bu.append(" ").append(t[b][f][r]);
				}
				bu.append("\n");
			} int f = 0; int f = 0; f 0 f < 3 f 3 f++ f++ f {
				for(int r = 0;r < 10;r++){
					bu.append(" ").append(t[b][f][r]);
				}
				bu.append("\n");
			} {
				for(int r = 0;r < 10;r++){
					bu.append(" ").append(t[b][f][r]);
				}
				bu.append("\n");
			} for(int r = 0;r < 10;r++){
					bu.append(" ").append(t[b][f][r]);
				} int r = 0; int r = 0; r 0 r < 10 r 10 r++ r++ r {
					bu.append(" ").append(t[b][f][r]);
				} {
					bu.append(" ").append(t[b][f][r]);
				} bu.append(" ").append(t[b][f][r]) bu.append(" ").append bu.append(" ") bu.append bu " " t[b][f][r] t[b][f] t[b] t b f r bu.append("\n") bu.append bu "\n" bu.append("####################\n") bu.append bu "####################\n" bu.delete(bu.lastIndexOf("#")-20,bu.lastIndexOf("\n")) bu.delete bu bu.lastIndexOf("#")-20 bu.lastIndexOf("#") bu.lastIndexOf bu "#" 20 bu.lastIndexOf("\n") bu.lastIndexOf bu "\n" System.out.print(bu) System.out.print System.out System System.out bu String[] args args public class Main {
	public static void main(String[] args) throws Exception{
		BufferedReader sc = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder bu = new StringBuilder();
		int[][][] t = new int[4][3][10];
		int n = Integer.parseInt(sc.readLine());
		for(int i=0;i<n;i++){
			String[] st= sc.readLine().split(" ");
			int b = Integer.parseInt(st[0]);
			int f = Integer.parseInt(st[1]);
			int r = Integer.parseInt(st[2]);
			int v = Integer.parseInt(st[3]);
			t[b-1][f-1][r-1] += v;
		}
		for(int b = 0;b < 4;b++){
			for(int f = 0;f < 3;f++){
				for(int r = 0;r < 10;r++){
					bu.append(" ").append(t[b][f][r]);
				}
				bu.append("\n");
			}
			bu.append("####################\n");
		}
		bu.delete(bu.lastIndexOf("#")-20,bu.lastIndexOf("\n"));
		System.out.print(bu);
	}
} public class Main {
	public static void main(String[] args) throws Exception{
		BufferedReader sc = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder bu = new StringBuilder();
		int[][][] t = new int[4][3][10];
		int n = Integer.parseInt(sc.readLine());
		for(int i=0;i<n;i++){
			String[] st= sc.readLine().split(" ");
			int b = Integer.parseInt(st[0]);
			int f = Integer.parseInt(st[1]);
			int r = Integer.parseInt(st[2]);
			int v = Integer.parseInt(st[3]);
			t[b-1][f-1][r-1] += v;
		}
		for(int b = 0;b < 4;b++){
			for(int f = 0;f < 3;f++){
				for(int r = 0;r < 10;r++){
					bu.append(" ").append(t[b][f][r]);
				}
				bu.append("\n");
			}
			bu.append("####################\n");
		}
		bu.delete(bu.lastIndexOf("#")-20,bu.lastIndexOf("\n"));
		System.out.print(bu);
	}
} Main
import java.io.*;
import java.lang.StringBuilder;
public class Main {
	public static void main(String[] args) throws Exception{
		BufferedReader sc = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder bu = new StringBuilder();
		int[][][] t = new int[4][3][10];
		int n = Integer.parseInt(sc.readLine());
		for(int i=0;i<n;i++){
			String[] st= sc.readLine().split(" ");
			int b = Integer.parseInt(st[0]);
			int f = Integer.parseInt(st[1]);
			int r = Integer.parseInt(st[2]);
			int v = Integer.parseInt(st[3]);
			t[b-1][f-1][r-1] += v;
		}
		for(int b = 0;b < 4;b++){
			for(int f = 0;f < 3;f++){
				for(int r = 0;r < 10;r++){
					bu.append(" ").append(t[b][f][r]);
				}
				bu.append("\n");
			}
			bu.append("####################\n");
		}
		bu.delete(bu.lastIndexOf("#")-20,bu.lastIndexOf("\n"));
		System.out.print(bu);
	}
}