import java.io.*;
public class Main {
	/**
	 * 公舎の入居者数を出力する
	 * @param args
	 * @throws IOException
	 */
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		//校舎の件数
		int n = Integer.parseInt(br.readLine());
		//トランプ全てのの配列
		int[][][] count = new int[4][3][10]; 
		//全ての部屋の人数を0人にする
		for(int i = 0; i < 4; i++){
			for(int l = 0; l < 3; l++){
				for(int k = 0; k < 10; k++){
					count[i][l][k] = 0;
				}//for
			}//for
		}//for
		//各棟、各部屋の人数を配列に入れる
		for(int i = 0; i < n; i++){
			String str  = br.readLine();
			String[] strs = str.split(" ");
			int b = Integer.parseInt(strs[0]) - 1;	//各棟
			int f = Integer.parseInt(strs[1]) - 1;	//階
			int r = Integer.parseInt(strs[2]) - 1;	//何番目
			int v = Integer.parseInt(strs[3]);
			count[b][f][r] += v;
			if(count[b][f][r] > 9){
				count[b][f][r] = 9;
			}else if(count[b][f][r] < 0){
				count[b][f][r] = 0;
			}
		}//for
		//出力
		for(int i = 0; i < 4; i++){
			if(i != 0){
				System.out.println("####################");
			}
			for(int l = 0; l < 3; l++){
				for(int k = 0; k < 10; k++){
					System.out.print(" ");
					System.out.print(count[i][l][k]);
				}//for
				System.out.println();
			}//for
		}//for
	}
} import java.io.*; io.* java public class Main {
	/**
	 * 公舎の入居者数を出力する
	 * @param args
	 * @throws IOException
	 */
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		//校舎の件数
		int n = Integer.parseInt(br.readLine());
		//トランプ全てのの配列
		int[][][] count = new int[4][3][10]; 
		//全ての部屋の人数を0人にする
		for(int i = 0; i < 4; i++){
			for(int l = 0; l < 3; l++){
				for(int k = 0; k < 10; k++){
					count[i][l][k] = 0;
				}//for
			}//for
		}//for
		//各棟、各部屋の人数を配列に入れる
		for(int i = 0; i < n; i++){
			String str  = br.readLine();
			String[] strs = str.split(" ");
			int b = Integer.parseInt(strs[0]) - 1;	//各棟
			int f = Integer.parseInt(strs[1]) - 1;	//階
			int r = Integer.parseInt(strs[2]) - 1;	//何番目
			int v = Integer.parseInt(strs[3]);
			count[b][f][r] += v;
			if(count[b][f][r] > 9){
				count[b][f][r] = 9;
			}else if(count[b][f][r] < 0){
				count[b][f][r] = 0;
			}
		}//for
		//出力
		for(int i = 0; i < 4; i++){
			if(i != 0){
				System.out.println("####################");
			}
			for(int l = 0; l < 3; l++){
				for(int k = 0; k < 10; k++){
					System.out.print(" ");
					System.out.print(count[i][l][k]);
				}//for
				System.out.println();
			}//for
		}//for
	}
} Main /**
	 * 公舎の入居者数を出力する
	 * @param args
	 * @throws IOException
	 */
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		//校舎の件数
		int n = Integer.parseInt(br.readLine());
		//トランプ全てのの配列
		int[][][] count = new int[4][3][10]; 
		//全ての部屋の人数を0人にする
		for(int i = 0; i < 4; i++){
			for(int l = 0; l < 3; l++){
				for(int k = 0; k < 10; k++){
					count[i][l][k] = 0;
				}//for
			}//for
		}//for
		//各棟、各部屋の人数を配列に入れる
		for(int i = 0; i < n; i++){
			String str  = br.readLine();
			String[] strs = str.split(" ");
			int b = Integer.parseInt(strs[0]) - 1;	//各棟
			int f = Integer.parseInt(strs[1]) - 1;	//階
			int r = Integer.parseInt(strs[2]) - 1;	//何番目
			int v = Integer.parseInt(strs[3]);
			count[b][f][r] += v;
			if(count[b][f][r] > 9){
				count[b][f][r] = 9;
			}else if(count[b][f][r] < 0){
				count[b][f][r] = 0;
			}
		}//for
		//出力
		for(int i = 0; i < 4; i++){
			if(i != 0){
				System.out.println("####################");
			}
			for(int l = 0; l < 3; l++){
				for(int k = 0; k < 10; k++){
					System.out.print(" ");
					System.out.print(count[i][l][k]);
				}//for
				System.out.println();
			}//for
		}//for
	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		//校舎の件数
		int n = Integer.parseInt(br.readLine());
		//トランプ全てのの配列
		int[][][] count = new int[4][3][10]; 
		//全ての部屋の人数を0人にする
		for(int i = 0; i < 4; i++){
			for(int l = 0; l < 3; l++){
				for(int k = 0; k < 10; k++){
					count[i][l][k] = 0;
				}//for
			}//for
		}//for
		//各棟、各部屋の人数を配列に入れる
		for(int i = 0; i < n; i++){
			String str  = br.readLine();
			String[] strs = str.split(" ");
			int b = Integer.parseInt(strs[0]) - 1;	//各棟
			int f = Integer.parseInt(strs[1]) - 1;	//階
			int r = Integer.parseInt(strs[2]) - 1;	//何番目
			int v = Integer.parseInt(strs[3]);
			count[b][f][r] += v;
			if(count[b][f][r] > 9){
				count[b][f][r] = 9;
			}else if(count[b][f][r] < 0){
				count[b][f][r] = 0;
			}
		}//for
		//出力
		for(int i = 0; i < 4; i++){
			if(i != 0){
				System.out.println("####################");
			}
			for(int l = 0; l < 3; l++){
				for(int k = 0; k < 10; k++){
					System.out.print(" ");
					System.out.print(count[i][l][k]);
				}//for
				System.out.println();
			}//for
		}//for
	} 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 int[][][] count = new int[4][3][10]; count new int[4][3][10] 4 3 10 for(int i = 0; i < 4; i++){
			for(int l = 0; l < 3; l++){
				for(int k = 0; k < 10; k++){
					count[i][l][k] = 0;
				}//for
			}//for
		}//for int i = 0; int i = 0; i 0 i < 4 i 4 i++ i++ i {
			for(int l = 0; l < 3; l++){
				for(int k = 0; k < 10; k++){
					count[i][l][k] = 0;
				}//for
			}//for
		}//for {
			for(int l = 0; l < 3; l++){
				for(int k = 0; k < 10; k++){
					count[i][l][k] = 0;
				}//for
			}//for
		} for(int l = 0; l < 3; l++){
				for(int k = 0; k < 10; k++){
					count[i][l][k] = 0;
				}//for
			}//for int l = 0; int l = 0; l 0 l < 3 l 3 l++ l++ l {
				for(int k = 0; k < 10; k++){
					count[i][l][k] = 0;
				}//for
			}//for {
				for(int k = 0; k < 10; k++){
					count[i][l][k] = 0;
				}//for
			} for(int k = 0; k < 10; k++){
					count[i][l][k] = 0;
				}//for int k = 0; int k = 0; k 0 k < 10 k 10 k++ k++ k {
					count[i][l][k] = 0;
				}//for {
					count[i][l][k] = 0;
				} count[i][l][k] = 0 count[i][l][k] count[i][l] count[i] count i l k 0 for(int i = 0; i < n; i++){
			String str  = br.readLine();
			String[] strs = str.split(" ");
			int b = Integer.parseInt(strs[0]) - 1;	//各棟
			int f = Integer.parseInt(strs[1]) - 1;	//階
			int r = Integer.parseInt(strs[2]) - 1;	//何番目
			int v = Integer.parseInt(strs[3]);
			count[b][f][r] += v;
			if(count[b][f][r] > 9){
				count[b][f][r] = 9;
			}else if(count[b][f][r] < 0){
				count[b][f][r] = 0;
			}
		}//for int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			String str  = br.readLine();
			String[] strs = str.split(" ");
			int b = Integer.parseInt(strs[0]) - 1;	//各棟
			int f = Integer.parseInt(strs[1]) - 1;	//階
			int r = Integer.parseInt(strs[2]) - 1;	//何番目
			int v = Integer.parseInt(strs[3]);
			count[b][f][r] += v;
			if(count[b][f][r] > 9){
				count[b][f][r] = 9;
			}else if(count[b][f][r] < 0){
				count[b][f][r] = 0;
			}
		}//for {
			String str  = br.readLine();
			String[] strs = str.split(" ");
			int b = Integer.parseInt(strs[0]) - 1;	//各棟
			int f = Integer.parseInt(strs[1]) - 1;	//階
			int r = Integer.parseInt(strs[2]) - 1;	//何番目
			int v = Integer.parseInt(strs[3]);
			count[b][f][r] += v;
			if(count[b][f][r] > 9){
				count[b][f][r] = 9;
			}else if(count[b][f][r] < 0){
				count[b][f][r] = 0;
			}
		} String str  = br.readLine(); str br.readLine() br.readLine br String[] strs = str.split(" "); strs str.split(" ") str.split str " " int b = Integer.parseInt(strs[0]) - 1; b Integer.parseInt(strs[0]) - 1 Integer.parseInt(strs[0]) Integer.parseInt Integer strs[0] strs 0 1 int f = Integer.parseInt(strs[1]) - 1; f Integer.parseInt(strs[1]) - 1 Integer.parseInt(strs[1]) Integer.parseInt Integer strs[1] strs 1 1 int r = Integer.parseInt(strs[2]) - 1; r Integer.parseInt(strs[2]) - 1 Integer.parseInt(strs[2]) Integer.parseInt Integer strs[2] strs 2 1 int v = Integer.parseInt(strs[3]); v Integer.parseInt(strs[3]) Integer.parseInt Integer strs[3] strs 3 count[b][f][r] += v count[b][f][r] count[b][f] count[b] count b f r v if(count[b][f][r] > 9){
				count[b][f][r] = 9;
			}else if(count[b][f][r] < 0){
				count[b][f][r] = 0;
			} count[b][f][r] > 9 count[b][f][r] count[b][f] count[b] count b f r 9 {
				count[b][f][r] = 9;
			} count[b][f][r] = 9 count[b][f][r] count[b][f] count[b] count b f r 9 if(count[b][f][r] < 0){
				count[b][f][r] = 0;
			} count[b][f][r] < 0 count[b][f][r] count[b][f] count[b] count b f r 0 {
				count[b][f][r] = 0;
			} count[b][f][r] = 0 count[b][f][r] count[b][f] count[b] count b f r 0 for(int i = 0; i < 4; i++){
			if(i != 0){
				System.out.println("####################");
			}
			for(int l = 0; l < 3; l++){
				for(int k = 0; k < 10; k++){
					System.out.print(" ");
					System.out.print(count[i][l][k]);
				}//for
				System.out.println();
			}//for
		}//for int i = 0; int i = 0; i 0 i < 4 i 4 i++ i++ i {
			if(i != 0){
				System.out.println("####################");
			}
			for(int l = 0; l < 3; l++){
				for(int k = 0; k < 10; k++){
					System.out.print(" ");
					System.out.print(count[i][l][k]);
				}//for
				System.out.println();
			}//for
		}//for {
			if(i != 0){
				System.out.println("####################");
			}
			for(int l = 0; l < 3; l++){
				for(int k = 0; k < 10; k++){
					System.out.print(" ");
					System.out.print(count[i][l][k]);
				}//for
				System.out.println();
			}//for
		} if(i != 0){
				System.out.println("####################");
			} i != 0 i 0 {
				System.out.println("####################");
			} System.out.println("####################") System.out.println System.out System System.out "####################" for(int l = 0; l < 3; l++){
				for(int k = 0; k < 10; k++){
					System.out.print(" ");
					System.out.print(count[i][l][k]);
				}//for
				System.out.println();
			}//for int l = 0; int l = 0; l 0 l < 3 l 3 l++ l++ l {
				for(int k = 0; k < 10; k++){
					System.out.print(" ");
					System.out.print(count[i][l][k]);
				}//for
				System.out.println();
			}//for {
				for(int k = 0; k < 10; k++){
					System.out.print(" ");
					System.out.print(count[i][l][k]);
				}//for
				System.out.println();
			} for(int k = 0; k < 10; k++){
					System.out.print(" ");
					System.out.print(count[i][l][k]);
				}//for int k = 0; int k = 0; k 0 k < 10 k 10 k++ k++ k {
					System.out.print(" ");
					System.out.print(count[i][l][k]);
				}//for {
					System.out.print(" ");
					System.out.print(count[i][l][k]);
				} System.out.print(" ") System.out.print System.out System System.out " " System.out.print(count[i][l][k]) System.out.print System.out System System.out count[i][l][k] count[i][l] count[i] count i l k System.out.println() System.out.println System.out System System.out String[] args args public class Main {
	/**
	 * 公舎の入居者数を出力する
	 * @param args
	 * @throws IOException
	 */
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		//校舎の件数
		int n = Integer.parseInt(br.readLine());
		//トランプ全てのの配列
		int[][][] count = new int[4][3][10]; 
		//全ての部屋の人数を0人にする
		for(int i = 0; i < 4; i++){
			for(int l = 0; l < 3; l++){
				for(int k = 0; k < 10; k++){
					count[i][l][k] = 0;
				}//for
			}//for
		}//for
		//各棟、各部屋の人数を配列に入れる
		for(int i = 0; i < n; i++){
			String str  = br.readLine();
			String[] strs = str.split(" ");
			int b = Integer.parseInt(strs[0]) - 1;	//各棟
			int f = Integer.parseInt(strs[1]) - 1;	//階
			int r = Integer.parseInt(strs[2]) - 1;	//何番目
			int v = Integer.parseInt(strs[3]);
			count[b][f][r] += v;
			if(count[b][f][r] > 9){
				count[b][f][r] = 9;
			}else if(count[b][f][r] < 0){
				count[b][f][r] = 0;
			}
		}//for
		//出力
		for(int i = 0; i < 4; i++){
			if(i != 0){
				System.out.println("####################");
			}
			for(int l = 0; l < 3; l++){
				for(int k = 0; k < 10; k++){
					System.out.print(" ");
					System.out.print(count[i][l][k]);
				}//for
				System.out.println();
			}//for
		}//for
	}
} public class Main {
	/**
	 * 公舎の入居者数を出力する
	 * @param args
	 * @throws IOException
	 */
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		//校舎の件数
		int n = Integer.parseInt(br.readLine());
		//トランプ全てのの配列
		int[][][] count = new int[4][3][10]; 
		//全ての部屋の人数を0人にする
		for(int i = 0; i < 4; i++){
			for(int l = 0; l < 3; l++){
				for(int k = 0; k < 10; k++){
					count[i][l][k] = 0;
				}//for
			}//for
		}//for
		//各棟、各部屋の人数を配列に入れる
		for(int i = 0; i < n; i++){
			String str  = br.readLine();
			String[] strs = str.split(" ");
			int b = Integer.parseInt(strs[0]) - 1;	//各棟
			int f = Integer.parseInt(strs[1]) - 1;	//階
			int r = Integer.parseInt(strs[2]) - 1;	//何番目
			int v = Integer.parseInt(strs[3]);
			count[b][f][r] += v;
			if(count[b][f][r] > 9){
				count[b][f][r] = 9;
			}else if(count[b][f][r] < 0){
				count[b][f][r] = 0;
			}
		}//for
		//出力
		for(int i = 0; i < 4; i++){
			if(i != 0){
				System.out.println("####################");
			}
			for(int l = 0; l < 3; l++){
				for(int k = 0; k < 10; k++){
					System.out.print(" ");
					System.out.print(count[i][l][k]);
				}//for
				System.out.println();
			}//for
		}//for
	}
} Main
import java.io.*;
public class Main {
	/**
	 * 公舎の入居者数を出力する
	 * @param args
	 * @throws IOException
	 */
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		//校舎の件数
		int n = Integer.parseInt(br.readLine());
		//トランプ全てのの配列
		int[][][] count = new int[4][3][10]; 
		//全ての部屋の人数を0人にする
		for(int i = 0; i < 4; i++){
			for(int l = 0; l < 3; l++){
				for(int k = 0; k < 10; k++){
					count[i][l][k] = 0;
				}//for
			}//for
		}//for
		//各棟、各部屋の人数を配列に入れる
		for(int i = 0; i < n; i++){
			String str  = br.readLine();
			String[] strs = str.split(" ");
			int b = Integer.parseInt(strs[0]) - 1;	//各棟
			int f = Integer.parseInt(strs[1]) - 1;	//階
			int r = Integer.parseInt(strs[2]) - 1;	//何番目
			int v = Integer.parseInt(strs[3]);
			count[b][f][r] += v;
			if(count[b][f][r] > 9){
				count[b][f][r] = 9;
			}else if(count[b][f][r] < 0){
				count[b][f][r] = 0;
			}
		}//for
		//出力
		for(int i = 0; i < 4; i++){
			if(i != 0){
				System.out.println("####################");
			}
			for(int l = 0; l < 3; l++){
				for(int k = 0; k < 10; k++){
					System.out.print(" ");
					System.out.print(count[i][l][k]);
				}//for
				System.out.println();
			}//for
		}//for
	}
}