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

public class Main {
	
	public static void main(String[] args) {
		try {
		
			int [][][] a = 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++) {
						a[i][j][k] = 0;
					}
				}
			}

			BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
			String s = reader.readLine();	
			int n = Integer.parseInt(s);

			String t;
			String[] u;
			int b, f, r, v;
			for (int l = 0; l < n; l++) {
				t = reader.readLine();
				u = t.split(" ");
				b = Integer.parseInt(u[0]);
				f = Integer.parseInt(u[1]);
				r = Integer.parseInt(u[2]);
				v = Integer.parseInt(u[3]);
				a[b - 1][f - 1][r - 1] += v;
			}
			
			for (int m = 0; m < 4; m++) {
				for (int o = 0; o < 3; o++) {
					for (int p = 0; p < 10; p++) {
						System.out.print(" ");
						System.out.print(a[m][o][p]);
					}
					System.out.println();
				}
				if (m != 3) {
					System.out.println("####################");
				}
			}
			
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

} 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) {
		try {
		
			int [][][] a = 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++) {
						a[i][j][k] = 0;
					}
				}
			}

			BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
			String s = reader.readLine();	
			int n = Integer.parseInt(s);

			String t;
			String[] u;
			int b, f, r, v;
			for (int l = 0; l < n; l++) {
				t = reader.readLine();
				u = t.split(" ");
				b = Integer.parseInt(u[0]);
				f = Integer.parseInt(u[1]);
				r = Integer.parseInt(u[2]);
				v = Integer.parseInt(u[3]);
				a[b - 1][f - 1][r - 1] += v;
			}
			
			for (int m = 0; m < 4; m++) {
				for (int o = 0; o < 3; o++) {
					for (int p = 0; p < 10; p++) {
						System.out.print(" ");
						System.out.print(a[m][o][p]);
					}
					System.out.println();
				}
				if (m != 3) {
					System.out.println("####################");
				}
			}
			
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

} Main public static void main(String[] args) {
		try {
		
			int [][][] a = 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++) {
						a[i][j][k] = 0;
					}
				}
			}

			BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
			String s = reader.readLine();	
			int n = Integer.parseInt(s);

			String t;
			String[] u;
			int b, f, r, v;
			for (int l = 0; l < n; l++) {
				t = reader.readLine();
				u = t.split(" ");
				b = Integer.parseInt(u[0]);
				f = Integer.parseInt(u[1]);
				r = Integer.parseInt(u[2]);
				v = Integer.parseInt(u[3]);
				a[b - 1][f - 1][r - 1] += v;
			}
			
			for (int m = 0; m < 4; m++) {
				for (int o = 0; o < 3; o++) {
					for (int p = 0; p < 10; p++) {
						System.out.print(" ");
						System.out.print(a[m][o][p]);
					}
					System.out.println();
				}
				if (m != 3) {
					System.out.println("####################");
				}
			}
			
		} catch (IOException e) {
			e.printStackTrace();
		}
	} main {
		try {
		
			int [][][] a = 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++) {
						a[i][j][k] = 0;
					}
				}
			}

			BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
			String s = reader.readLine();	
			int n = Integer.parseInt(s);

			String t;
			String[] u;
			int b, f, r, v;
			for (int l = 0; l < n; l++) {
				t = reader.readLine();
				u = t.split(" ");
				b = Integer.parseInt(u[0]);
				f = Integer.parseInt(u[1]);
				r = Integer.parseInt(u[2]);
				v = Integer.parseInt(u[3]);
				a[b - 1][f - 1][r - 1] += v;
			}
			
			for (int m = 0; m < 4; m++) {
				for (int o = 0; o < 3; o++) {
					for (int p = 0; p < 10; p++) {
						System.out.print(" ");
						System.out.print(a[m][o][p]);
					}
					System.out.println();
				}
				if (m != 3) {
					System.out.println("####################");
				}
			}
			
		} catch (IOException e) {
			e.printStackTrace();
		}
	} try {
		
			int [][][] a = 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++) {
						a[i][j][k] = 0;
					}
				}
			}

			BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
			String s = reader.readLine();	
			int n = Integer.parseInt(s);

			String t;
			String[] u;
			int b, f, r, v;
			for (int l = 0; l < n; l++) {
				t = reader.readLine();
				u = t.split(" ");
				b = Integer.parseInt(u[0]);
				f = Integer.parseInt(u[1]);
				r = Integer.parseInt(u[2]);
				v = Integer.parseInt(u[3]);
				a[b - 1][f - 1][r - 1] += v;
			}
			
			for (int m = 0; m < 4; m++) {
				for (int o = 0; o < 3; o++) {
					for (int p = 0; p < 10; p++) {
						System.out.print(" ");
						System.out.print(a[m][o][p]);
					}
					System.out.println();
				}
				if (m != 3) {
					System.out.println("####################");
				}
			}
			
		} catch (IOException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		} IOException e {
			e.printStackTrace();
		} e.printStackTrace() e.printStackTrace e {
		
			int [][][] a = 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++) {
						a[i][j][k] = 0;
					}
				}
			}

			BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
			String s = reader.readLine();	
			int n = Integer.parseInt(s);

			String t;
			String[] u;
			int b, f, r, v;
			for (int l = 0; l < n; l++) {
				t = reader.readLine();
				u = t.split(" ");
				b = Integer.parseInt(u[0]);
				f = Integer.parseInt(u[1]);
				r = Integer.parseInt(u[2]);
				v = Integer.parseInt(u[3]);
				a[b - 1][f - 1][r - 1] += v;
			}
			
			for (int m = 0; m < 4; m++) {
				for (int o = 0; o < 3; o++) {
					for (int p = 0; p < 10; p++) {
						System.out.print(" ");
						System.out.print(a[m][o][p]);
					}
					System.out.println();
				}
				if (m != 3) {
					System.out.println("####################");
				}
			}
			
		} int [][][] a = new int[4][3][10]; a 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++) {
						a[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++) {
						a[i][j][k] = 0;
					}
				}
			} {
				for (int j = 0; j < 3; j++) {
					for (int k = 0; k < 10; k++) {
						a[i][j][k] = 0;
					}
				}
			} for (int j = 0; j < 3; j++) {
					for (int k = 0; k < 10; k++) {
						a[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++) {
						a[i][j][k] = 0;
					}
				} {
					for (int k = 0; k < 10; k++) {
						a[i][j][k] = 0;
					}
				} for (int k = 0; k < 10; k++) {
						a[i][j][k] = 0;
					} int k = 0; int k = 0; k 0 k < 10 k 10 k++ k++ k {
						a[i][j][k] = 0;
					} {
						a[i][j][k] = 0;
					} a[i][j][k] = 0 a[i][j][k] a[i][j] a[i] a i j k 0 BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); reader new BufferedReader(new InputStreamReader(System.in)) String s = reader.readLine(); s reader.readLine() reader.readLine reader int n = Integer.parseInt(s); n Integer.parseInt(s) Integer.parseInt Integer s String t; t String[] u; u int b b f f r r v; v for (int l = 0; l < n; l++) {
				t = reader.readLine();
				u = t.split(" ");
				b = Integer.parseInt(u[0]);
				f = Integer.parseInt(u[1]);
				r = Integer.parseInt(u[2]);
				v = Integer.parseInt(u[3]);
				a[b - 1][f - 1][r - 1] += v;
			} int l = 0; int l = 0; l 0 l < n l n l++ l++ l {
				t = reader.readLine();
				u = t.split(" ");
				b = Integer.parseInt(u[0]);
				f = Integer.parseInt(u[1]);
				r = Integer.parseInt(u[2]);
				v = Integer.parseInt(u[3]);
				a[b - 1][f - 1][r - 1] += v;
			} {
				t = reader.readLine();
				u = t.split(" ");
				b = Integer.parseInt(u[0]);
				f = Integer.parseInt(u[1]);
				r = Integer.parseInt(u[2]);
				v = Integer.parseInt(u[3]);
				a[b - 1][f - 1][r - 1] += v;
			} t = reader.readLine() t reader.readLine() reader.readLine reader u = t.split(" ") u t.split(" ") t.split t " " b = Integer.parseInt(u[0]) b Integer.parseInt(u[0]) Integer.parseInt Integer u[0] u 0 f = Integer.parseInt(u[1]) f Integer.parseInt(u[1]) Integer.parseInt Integer u[1] u 1 r = Integer.parseInt(u[2]) r Integer.parseInt(u[2]) Integer.parseInt Integer u[2] u 2 v = Integer.parseInt(u[3]) v Integer.parseInt(u[3]) Integer.parseInt Integer u[3] u 3 a[b - 1][f - 1][r - 1] += v a[b - 1][f - 1][r - 1] a[b - 1][f - 1] a[b - 1] a b - 1 b 1 f - 1 f 1 r - 1 r 1 v for (int m = 0; m < 4; m++) {
				for (int o = 0; o < 3; o++) {
					for (int p = 0; p < 10; p++) {
						System.out.print(" ");
						System.out.print(a[m][o][p]);
					}
					System.out.println();
				}
				if (m != 3) {
					System.out.println("####################");
				}
			} int m = 0; int m = 0; m 0 m < 4 m 4 m++ m++ m {
				for (int o = 0; o < 3; o++) {
					for (int p = 0; p < 10; p++) {
						System.out.print(" ");
						System.out.print(a[m][o][p]);
					}
					System.out.println();
				}
				if (m != 3) {
					System.out.println("####################");
				}
			} {
				for (int o = 0; o < 3; o++) {
					for (int p = 0; p < 10; p++) {
						System.out.print(" ");
						System.out.print(a[m][o][p]);
					}
					System.out.println();
				}
				if (m != 3) {
					System.out.println("####################");
				}
			} for (int o = 0; o < 3; o++) {
					for (int p = 0; p < 10; p++) {
						System.out.print(" ");
						System.out.print(a[m][o][p]);
					}
					System.out.println();
				} int o = 0; int o = 0; o 0 o < 3 o 3 o++ o++ o {
					for (int p = 0; p < 10; p++) {
						System.out.print(" ");
						System.out.print(a[m][o][p]);
					}
					System.out.println();
				} {
					for (int p = 0; p < 10; p++) {
						System.out.print(" ");
						System.out.print(a[m][o][p]);
					}
					System.out.println();
				} for (int p = 0; p < 10; p++) {
						System.out.print(" ");
						System.out.print(a[m][o][p]);
					} int p = 0; int p = 0; p 0 p < 10 p 10 p++ p++ p {
						System.out.print(" ");
						System.out.print(a[m][o][p]);
					} {
						System.out.print(" ");
						System.out.print(a[m][o][p]);
					} System.out.print(" ") System.out.print System.out System System.out " " System.out.print(a[m][o][p]) System.out.print System.out System System.out a[m][o][p] a[m][o] a[m] a m o p System.out.println() System.out.println System.out System System.out if (m != 3) {
					System.out.println("####################");
				} m != 3 m 3 {
					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) {
		try {
		
			int [][][] a = 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++) {
						a[i][j][k] = 0;
					}
				}
			}

			BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
			String s = reader.readLine();	
			int n = Integer.parseInt(s);

			String t;
			String[] u;
			int b, f, r, v;
			for (int l = 0; l < n; l++) {
				t = reader.readLine();
				u = t.split(" ");
				b = Integer.parseInt(u[0]);
				f = Integer.parseInt(u[1]);
				r = Integer.parseInt(u[2]);
				v = Integer.parseInt(u[3]);
				a[b - 1][f - 1][r - 1] += v;
			}
			
			for (int m = 0; m < 4; m++) {
				for (int o = 0; o < 3; o++) {
					for (int p = 0; p < 10; p++) {
						System.out.print(" ");
						System.out.print(a[m][o][p]);
					}
					System.out.println();
				}
				if (m != 3) {
					System.out.println("####################");
				}
			}
			
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

} public class Main {
	
	public static void main(String[] args) {
		try {
		
			int [][][] a = 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++) {
						a[i][j][k] = 0;
					}
				}
			}

			BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
			String s = reader.readLine();	
			int n = Integer.parseInt(s);

			String t;
			String[] u;
			int b, f, r, v;
			for (int l = 0; l < n; l++) {
				t = reader.readLine();
				u = t.split(" ");
				b = Integer.parseInt(u[0]);
				f = Integer.parseInt(u[1]);
				r = Integer.parseInt(u[2]);
				v = Integer.parseInt(u[3]);
				a[b - 1][f - 1][r - 1] += v;
			}
			
			for (int m = 0; m < 4; m++) {
				for (int o = 0; o < 3; o++) {
					for (int p = 0; p < 10; p++) {
						System.out.print(" ");
						System.out.print(a[m][o][p]);
					}
					System.out.println();
				}
				if (m != 3) {
					System.out.println("####################");
				}
			}
			
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

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

public class Main {
	
	public static void main(String[] args) {
		try {
		
			int [][][] a = 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++) {
						a[i][j][k] = 0;
					}
				}
			}

			BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
			String s = reader.readLine();	
			int n = Integer.parseInt(s);

			String t;
			String[] u;
			int b, f, r, v;
			for (int l = 0; l < n; l++) {
				t = reader.readLine();
				u = t.split(" ");
				b = Integer.parseInt(u[0]);
				f = Integer.parseInt(u[1]);
				r = Integer.parseInt(u[2]);
				v = Integer.parseInt(u[3]);
				a[b - 1][f - 1][r - 1] += v;
			}
			
			for (int m = 0; m < 4; m++) {
				for (int o = 0; o < 3; o++) {
					for (int p = 0; p < 10; p++) {
						System.out.print(" ");
						System.out.print(a[m][o][p]);
					}
					System.out.println();
				}
				if (m != 3) {
					System.out.println("####################");
				}
			}
			
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

}