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

class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuffer sb = new StringBuffer();
		
		int count = Integer.parseInt(br.readLine());
		int[][][] list = new int[4][3][10];
		
		for (int i = 0; i < count; i++) {
			String[] str = br.readLine().split(" ");
			int num01 = Integer.parseInt(str[0]) - 1;
			int num02 = Integer.parseInt(str[1]) - 1;
			int num03 = Integer.parseInt(str[2]) - 1;
			int human = Integer.parseInt(str[3]);
			list[num01][num02][num03] += human;
		}
		
		for (int i = 0; i < list.length; i++) {
			if (!(i == 0)) {
				sb.append("####################");
				sb.append('\n');
			}
			for (int j = 0; j < list[i].length; j++) {
				for (int k = 0; k < list[i][j].length; k++) {
					sb.append(" " + list[i][j][k]);
					if(k == 9){
						sb.append('\n');
					}
					if (k == list[i][j].length - 1) {
						sb.append("");
					}
				}
			}
		}
		System.out.print(sb.toString());
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuffer sb = new StringBuffer();
		
		int count = Integer.parseInt(br.readLine());
		int[][][] list = new int[4][3][10];
		
		for (int i = 0; i < count; i++) {
			String[] str = br.readLine().split(" ");
			int num01 = Integer.parseInt(str[0]) - 1;
			int num02 = Integer.parseInt(str[1]) - 1;
			int num03 = Integer.parseInt(str[2]) - 1;
			int human = Integer.parseInt(str[3]);
			list[num01][num02][num03] += human;
		}
		
		for (int i = 0; i < list.length; i++) {
			if (!(i == 0)) {
				sb.append("####################");
				sb.append('\n');
			}
			for (int j = 0; j < list[i].length; j++) {
				for (int k = 0; k < list[i][j].length; k++) {
					sb.append(" " + list[i][j][k]);
					if(k == 9){
						sb.append('\n');
					}
					if (k == list[i][j].length - 1) {
						sb.append("");
					}
				}
			}
		}
		System.out.print(sb.toString());
	}
} Main public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuffer sb = new StringBuffer();
		
		int count = Integer.parseInt(br.readLine());
		int[][][] list = new int[4][3][10];
		
		for (int i = 0; i < count; i++) {
			String[] str = br.readLine().split(" ");
			int num01 = Integer.parseInt(str[0]) - 1;
			int num02 = Integer.parseInt(str[1]) - 1;
			int num03 = Integer.parseInt(str[2]) - 1;
			int human = Integer.parseInt(str[3]);
			list[num01][num02][num03] += human;
		}
		
		for (int i = 0; i < list.length; i++) {
			if (!(i == 0)) {
				sb.append("####################");
				sb.append('\n');
			}
			for (int j = 0; j < list[i].length; j++) {
				for (int k = 0; k < list[i][j].length; k++) {
					sb.append(" " + list[i][j][k]);
					if(k == 9){
						sb.append('\n');
					}
					if (k == list[i][j].length - 1) {
						sb.append("");
					}
				}
			}
		}
		System.out.print(sb.toString());
	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuffer sb = new StringBuffer();
		
		int count = Integer.parseInt(br.readLine());
		int[][][] list = new int[4][3][10];
		
		for (int i = 0; i < count; i++) {
			String[] str = br.readLine().split(" ");
			int num01 = Integer.parseInt(str[0]) - 1;
			int num02 = Integer.parseInt(str[1]) - 1;
			int num03 = Integer.parseInt(str[2]) - 1;
			int human = Integer.parseInt(str[3]);
			list[num01][num02][num03] += human;
		}
		
		for (int i = 0; i < list.length; i++) {
			if (!(i == 0)) {
				sb.append("####################");
				sb.append('\n');
			}
			for (int j = 0; j < list[i].length; j++) {
				for (int k = 0; k < list[i][j].length; k++) {
					sb.append(" " + list[i][j][k]);
					if(k == 9){
						sb.append('\n');
					}
					if (k == list[i][j].length - 1) {
						sb.append("");
					}
				}
			}
		}
		System.out.print(sb.toString());
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) StringBuffer sb = new StringBuffer(); sb new StringBuffer() int count = Integer.parseInt(br.readLine()); count Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br int[][][] list = new int[4][3][10]; list new int[4][3][10] 4 3 10 for (int i = 0; i < count; i++) {
			String[] str = br.readLine().split(" ");
			int num01 = Integer.parseInt(str[0]) - 1;
			int num02 = Integer.parseInt(str[1]) - 1;
			int num03 = Integer.parseInt(str[2]) - 1;
			int human = Integer.parseInt(str[3]);
			list[num01][num02][num03] += human;
		} int i = 0; int i = 0; i 0 i < count i count i++ i++ i {
			String[] str = br.readLine().split(" ");
			int num01 = Integer.parseInt(str[0]) - 1;
			int num02 = Integer.parseInt(str[1]) - 1;
			int num03 = Integer.parseInt(str[2]) - 1;
			int human = Integer.parseInt(str[3]);
			list[num01][num02][num03] += human;
		} {
			String[] str = br.readLine().split(" ");
			int num01 = Integer.parseInt(str[0]) - 1;
			int num02 = Integer.parseInt(str[1]) - 1;
			int num03 = Integer.parseInt(str[2]) - 1;
			int human = Integer.parseInt(str[3]);
			list[num01][num02][num03] += human;
		} String[] str = br.readLine().split(" "); str br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " int num01 = Integer.parseInt(str[0]) - 1; num01 Integer.parseInt(str[0]) - 1 Integer.parseInt(str[0]) Integer.parseInt Integer str[0] str 0 1 int num02 = Integer.parseInt(str[1]) - 1; num02 Integer.parseInt(str[1]) - 1 Integer.parseInt(str[1]) Integer.parseInt Integer str[1] str 1 1 int num03 = Integer.parseInt(str[2]) - 1; num03 Integer.parseInt(str[2]) - 1 Integer.parseInt(str[2]) Integer.parseInt Integer str[2] str 2 1 int human = Integer.parseInt(str[3]); human Integer.parseInt(str[3]) Integer.parseInt Integer str[3] str 3 list[num01][num02][num03] += human list[num01][num02][num03] list[num01][num02] list[num01] list num01 num02 num03 human for (int i = 0; i < list.length; i++) {
			if (!(i == 0)) {
				sb.append("####################");
				sb.append('\n');
			}
			for (int j = 0; j < list[i].length; j++) {
				for (int k = 0; k < list[i][j].length; k++) {
					sb.append(" " + list[i][j][k]);
					if(k == 9){
						sb.append('\n');
					}
					if (k == list[i][j].length - 1) {
						sb.append("");
					}
				}
			}
		} int i = 0; int i = 0; i 0 i < list.length i list.length list list.length i++ i++ i {
			if (!(i == 0)) {
				sb.append("####################");
				sb.append('\n');
			}
			for (int j = 0; j < list[i].length; j++) {
				for (int k = 0; k < list[i][j].length; k++) {
					sb.append(" " + list[i][j][k]);
					if(k == 9){
						sb.append('\n');
					}
					if (k == list[i][j].length - 1) {
						sb.append("");
					}
				}
			}
		} {
			if (!(i == 0)) {
				sb.append("####################");
				sb.append('\n');
			}
			for (int j = 0; j < list[i].length; j++) {
				for (int k = 0; k < list[i][j].length; k++) {
					sb.append(" " + list[i][j][k]);
					if(k == 9){
						sb.append('\n');
					}
					if (k == list[i][j].length - 1) {
						sb.append("");
					}
				}
			}
		} if (!(i == 0)) {
				sb.append("####################");
				sb.append('\n');
			} !(i == 0) (i == 0) i 0 {
				sb.append("####################");
				sb.append('\n');
			} sb.append("####################") sb.append sb "####################" sb.append('\n') sb.append sb '\n' for (int j = 0; j < list[i].length; j++) {
				for (int k = 0; k < list[i][j].length; k++) {
					sb.append(" " + list[i][j][k]);
					if(k == 9){
						sb.append('\n');
					}
					if (k == list[i][j].length - 1) {
						sb.append("");
					}
				}
			} int j = 0; int j = 0; j 0 j < list[i].length j list[i].length list[i] list i list[i].length j++ j++ j {
				for (int k = 0; k < list[i][j].length; k++) {
					sb.append(" " + list[i][j][k]);
					if(k == 9){
						sb.append('\n');
					}
					if (k == list[i][j].length - 1) {
						sb.append("");
					}
				}
			} {
				for (int k = 0; k < list[i][j].length; k++) {
					sb.append(" " + list[i][j][k]);
					if(k == 9){
						sb.append('\n');
					}
					if (k == list[i][j].length - 1) {
						sb.append("");
					}
				}
			} for (int k = 0; k < list[i][j].length; k++) {
					sb.append(" " + list[i][j][k]);
					if(k == 9){
						sb.append('\n');
					}
					if (k == list[i][j].length - 1) {
						sb.append("");
					}
				} int k = 0; int k = 0; k 0 k < list[i][j].length k list[i][j].length list[i][j] list[i] list i j list[i][j].length k++ k++ k {
					sb.append(" " + list[i][j][k]);
					if(k == 9){
						sb.append('\n');
					}
					if (k == list[i][j].length - 1) {
						sb.append("");
					}
				} {
					sb.append(" " + list[i][j][k]);
					if(k == 9){
						sb.append('\n');
					}
					if (k == list[i][j].length - 1) {
						sb.append("");
					}
				} sb.append(" " + list[i][j][k]) sb.append sb " " + list[i][j][k] " " list[i][j][k] list[i][j] list[i] list i j k if(k == 9){
						sb.append('\n');
					} k == 9 k 9 {
						sb.append('\n');
					} sb.append('\n') sb.append sb '\n' if (k == list[i][j].length - 1) {
						sb.append("");
					} k == list[i][j].length - 1 k list[i][j].length - 1 list[i][j].length list[i][j] list[i] list i j list[i][j].length 1 {
						sb.append("");
					} sb.append("") sb.append sb "" System.out.print(sb.toString()) System.out.print System.out System System.out sb.toString() sb.toString sb String[] args args
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuffer sb = new StringBuffer();
		
		int count = Integer.parseInt(br.readLine());
		int[][][] list = new int[4][3][10];
		
		for (int i = 0; i < count; i++) {
			String[] str = br.readLine().split(" ");
			int num01 = Integer.parseInt(str[0]) - 1;
			int num02 = Integer.parseInt(str[1]) - 1;
			int num03 = Integer.parseInt(str[2]) - 1;
			int human = Integer.parseInt(str[3]);
			list[num01][num02][num03] += human;
		}
		
		for (int i = 0; i < list.length; i++) {
			if (!(i == 0)) {
				sb.append("####################");
				sb.append('\n');
			}
			for (int j = 0; j < list[i].length; j++) {
				for (int k = 0; k < list[i][j].length; k++) {
					sb.append(" " + list[i][j][k]);
					if(k == 9){
						sb.append('\n');
					}
					if (k == list[i][j].length - 1) {
						sb.append("");
					}
				}
			}
		}
		System.out.print(sb.toString());
	}
}