import java.util.Scanner;

public class Main{

	static int[][][] arrayFloor = new int[4][3][10];

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();

		//??????????????????
		for(int k = 0; k < 4; k++) {
			for(int i = 0; i < 3; i++) {
				for(int j = 0; j < 10; j++) {
					arrayFloor[k][i][j] = 0;
				}
			}
		}

		for(int i = 0; i < A; i++) {

			int b = sc.nextInt();
			int f = sc.nextInt();
			int r = sc.nextInt();
			int v = sc.nextInt();

			switch(b) {
			case 1:
				calculate(b, f, r, v);
				break;

			case 2:
				calculate(b, f, r, v);
				break;

			case 3:
				calculate(b, f, r, v);
				break;

			case 4:
				calculate(b, f, r, v);
				break;
			}

		}

		for(int k = 0; k < 4; k++) {
			for(int i = 0; i < 3; i++) {
				for(int j = 0; j < 10; j++) {
					System.out.print(" "+arrayFloor[k][i][j]);
				}
				System.out.println("");
			}
			if(!(k == 3)) {
				System.out.println("####################");
			}
		}


	}
	public static void calculate(int b, int f, int r, int v) {

		if(arrayFloor[b-1][f-1][r-1] != 0) {
			arrayFloor[b-1][f-1][r-1] = arrayFloor[b-1][f-1][r-1] + v;
		}
		else {
			arrayFloor[b-1][f-1][r-1] = v;
		}
	}
} import java.util.Scanner; Scanner java.util public class Main{

	static int[][][] arrayFloor = new int[4][3][10];

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();

		//??????????????????
		for(int k = 0; k < 4; k++) {
			for(int i = 0; i < 3; i++) {
				for(int j = 0; j < 10; j++) {
					arrayFloor[k][i][j] = 0;
				}
			}
		}

		for(int i = 0; i < A; i++) {

			int b = sc.nextInt();
			int f = sc.nextInt();
			int r = sc.nextInt();
			int v = sc.nextInt();

			switch(b) {
			case 1:
				calculate(b, f, r, v);
				break;

			case 2:
				calculate(b, f, r, v);
				break;

			case 3:
				calculate(b, f, r, v);
				break;

			case 4:
				calculate(b, f, r, v);
				break;
			}

		}

		for(int k = 0; k < 4; k++) {
			for(int i = 0; i < 3; i++) {
				for(int j = 0; j < 10; j++) {
					System.out.print(" "+arrayFloor[k][i][j]);
				}
				System.out.println("");
			}
			if(!(k == 3)) {
				System.out.println("####################");
			}
		}


	}
	public static void calculate(int b, int f, int r, int v) {

		if(arrayFloor[b-1][f-1][r-1] != 0) {
			arrayFloor[b-1][f-1][r-1] = arrayFloor[b-1][f-1][r-1] + v;
		}
		else {
			arrayFloor[b-1][f-1][r-1] = v;
		}
	}
} Main static int[][][] arrayFloor = new int[4][3][10]; arrayFloor new int[4][3][10] 4 3 10 public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();

		//??????????????????
		for(int k = 0; k < 4; k++) {
			for(int i = 0; i < 3; i++) {
				for(int j = 0; j < 10; j++) {
					arrayFloor[k][i][j] = 0;
				}
			}
		}

		for(int i = 0; i < A; i++) {

			int b = sc.nextInt();
			int f = sc.nextInt();
			int r = sc.nextInt();
			int v = sc.nextInt();

			switch(b) {
			case 1:
				calculate(b, f, r, v);
				break;

			case 2:
				calculate(b, f, r, v);
				break;

			case 3:
				calculate(b, f, r, v);
				break;

			case 4:
				calculate(b, f, r, v);
				break;
			}

		}

		for(int k = 0; k < 4; k++) {
			for(int i = 0; i < 3; i++) {
				for(int j = 0; j < 10; j++) {
					System.out.print(" "+arrayFloor[k][i][j]);
				}
				System.out.println("");
			}
			if(!(k == 3)) {
				System.out.println("####################");
			}
		}


	} main {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();

		//??????????????????
		for(int k = 0; k < 4; k++) {
			for(int i = 0; i < 3; i++) {
				for(int j = 0; j < 10; j++) {
					arrayFloor[k][i][j] = 0;
				}
			}
		}

		for(int i = 0; i < A; i++) {

			int b = sc.nextInt();
			int f = sc.nextInt();
			int r = sc.nextInt();
			int v = sc.nextInt();

			switch(b) {
			case 1:
				calculate(b, f, r, v);
				break;

			case 2:
				calculate(b, f, r, v);
				break;

			case 3:
				calculate(b, f, r, v);
				break;

			case 4:
				calculate(b, f, r, v);
				break;
			}

		}

		for(int k = 0; k < 4; k++) {
			for(int i = 0; i < 3; i++) {
				for(int j = 0; j < 10; j++) {
					System.out.print(" "+arrayFloor[k][i][j]);
				}
				System.out.println("");
			}
			if(!(k == 3)) {
				System.out.println("####################");
			}
		}


	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int A = sc.nextInt(); A sc.nextInt() sc.nextInt sc for(int k = 0; k < 4; k++) {
			for(int i = 0; i < 3; i++) {
				for(int j = 0; j < 10; j++) {
					arrayFloor[k][i][j] = 0;
				}
			}
		} int k = 0; int k = 0; k 0 k < 4 k 4 k++ k++ k {
			for(int i = 0; i < 3; i++) {
				for(int j = 0; j < 10; j++) {
					arrayFloor[k][i][j] = 0;
				}
			}
		} {
			for(int i = 0; i < 3; i++) {
				for(int j = 0; j < 10; j++) {
					arrayFloor[k][i][j] = 0;
				}
			}
		} for(int i = 0; i < 3; i++) {
				for(int j = 0; j < 10; j++) {
					arrayFloor[k][i][j] = 0;
				}
			} int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
				for(int j = 0; j < 10; j++) {
					arrayFloor[k][i][j] = 0;
				}
			} {
				for(int j = 0; j < 10; j++) {
					arrayFloor[k][i][j] = 0;
				}
			} for(int j = 0; j < 10; j++) {
					arrayFloor[k][i][j] = 0;
				} int j = 0; int j = 0; j 0 j < 10 j 10 j++ j++ j {
					arrayFloor[k][i][j] = 0;
				} {
					arrayFloor[k][i][j] = 0;
				} arrayFloor[k][i][j] = 0 arrayFloor[k][i][j] arrayFloor[k][i] arrayFloor[k] arrayFloor k i j 0 for(int i = 0; i < A; i++) {

			int b = sc.nextInt();
			int f = sc.nextInt();
			int r = sc.nextInt();
			int v = sc.nextInt();

			switch(b) {
			case 1:
				calculate(b, f, r, v);
				break;

			case 2:
				calculate(b, f, r, v);
				break;

			case 3:
				calculate(b, f, r, v);
				break;

			case 4:
				calculate(b, f, r, v);
				break;
			}

		} int i = 0; int i = 0; i 0 i < A i A i++ i++ i {

			int b = sc.nextInt();
			int f = sc.nextInt();
			int r = sc.nextInt();
			int v = sc.nextInt();

			switch(b) {
			case 1:
				calculate(b, f, r, v);
				break;

			case 2:
				calculate(b, f, r, v);
				break;

			case 3:
				calculate(b, f, r, v);
				break;

			case 4:
				calculate(b, f, r, v);
				break;
			}

		} {

			int b = sc.nextInt();
			int f = sc.nextInt();
			int r = sc.nextInt();
			int v = sc.nextInt();

			switch(b) {
			case 1:
				calculate(b, f, r, v);
				break;

			case 2:
				calculate(b, f, r, v);
				break;

			case 3:
				calculate(b, f, r, v);
				break;

			case 4:
				calculate(b, f, r, v);
				break;
			}

		} int b = sc.nextInt(); b sc.nextInt() sc.nextInt sc int f = sc.nextInt(); f sc.nextInt() sc.nextInt sc int r = sc.nextInt(); r sc.nextInt() sc.nextInt sc int v = sc.nextInt(); v sc.nextInt() sc.nextInt sc switch(b) {
			case 1:
				calculate(b, f, r, v);
				break;

			case 2:
				calculate(b, f, r, v);
				break;

			case 3:
				calculate(b, f, r, v);
				break;

			case 4:
				calculate(b, f, r, v);
				break;
			} b case 1: 1 case 1: calculate(b, f, r, v) calculate b f r v break; case 2: 2 case 2: calculate(b, f, r, v) calculate b f r v break; case 3: 3 case 3: calculate(b, f, r, v) calculate b f r v break; case 4: 4 case 4: calculate(b, f, r, v) calculate b f r v break; for(int k = 0; k < 4; k++) {
			for(int i = 0; i < 3; i++) {
				for(int j = 0; j < 10; j++) {
					System.out.print(" "+arrayFloor[k][i][j]);
				}
				System.out.println("");
			}
			if(!(k == 3)) {
				System.out.println("####################");
			}
		} int k = 0; int k = 0; k 0 k < 4 k 4 k++ k++ k {
			for(int i = 0; i < 3; i++) {
				for(int j = 0; j < 10; j++) {
					System.out.print(" "+arrayFloor[k][i][j]);
				}
				System.out.println("");
			}
			if(!(k == 3)) {
				System.out.println("####################");
			}
		} {
			for(int i = 0; i < 3; i++) {
				for(int j = 0; j < 10; j++) {
					System.out.print(" "+arrayFloor[k][i][j]);
				}
				System.out.println("");
			}
			if(!(k == 3)) {
				System.out.println("####################");
			}
		} for(int i = 0; i < 3; i++) {
				for(int j = 0; j < 10; j++) {
					System.out.print(" "+arrayFloor[k][i][j]);
				}
				System.out.println("");
			} int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
				for(int j = 0; j < 10; j++) {
					System.out.print(" "+arrayFloor[k][i][j]);
				}
				System.out.println("");
			} {
				for(int j = 0; j < 10; j++) {
					System.out.print(" "+arrayFloor[k][i][j]);
				}
				System.out.println("");
			} for(int j = 0; j < 10; j++) {
					System.out.print(" "+arrayFloor[k][i][j]);
				} int j = 0; int j = 0; j 0 j < 10 j 10 j++ j++ j {
					System.out.print(" "+arrayFloor[k][i][j]);
				} {
					System.out.print(" "+arrayFloor[k][i][j]);
				} System.out.print(" "+arrayFloor[k][i][j]) System.out.print System.out System System.out " "+arrayFloor[k][i][j] " " arrayFloor[k][i][j] arrayFloor[k][i] arrayFloor[k] arrayFloor k i j System.out.println("") System.out.println System.out System System.out "" if(!(k == 3)) {
				System.out.println("####################");
			} !(k == 3) (k == 3) k 3 {
				System.out.println("####################");
			} System.out.println("####################") System.out.println System.out System System.out "####################" String[] args args public static void calculate(int b, int f, int r, int v) {

		if(arrayFloor[b-1][f-1][r-1] != 0) {
			arrayFloor[b-1][f-1][r-1] = arrayFloor[b-1][f-1][r-1] + v;
		}
		else {
			arrayFloor[b-1][f-1][r-1] = v;
		}
	} calculate {

		if(arrayFloor[b-1][f-1][r-1] != 0) {
			arrayFloor[b-1][f-1][r-1] = arrayFloor[b-1][f-1][r-1] + v;
		}
		else {
			arrayFloor[b-1][f-1][r-1] = v;
		}
	} if(arrayFloor[b-1][f-1][r-1] != 0) {
			arrayFloor[b-1][f-1][r-1] = arrayFloor[b-1][f-1][r-1] + v;
		}
		else {
			arrayFloor[b-1][f-1][r-1] = v;
		} arrayFloor[b-1][f-1][r-1] != 0 arrayFloor[b-1][f-1][r-1] arrayFloor[b-1][f-1] arrayFloor[b-1] arrayFloor b-1 b 1 f-1 f 1 r-1 r 1 0 {
			arrayFloor[b-1][f-1][r-1] = arrayFloor[b-1][f-1][r-1] + v;
		} arrayFloor[b-1][f-1][r-1] = arrayFloor[b-1][f-1][r-1] + v arrayFloor[b-1][f-1][r-1] arrayFloor[b-1][f-1] arrayFloor[b-1] arrayFloor b-1 b 1 f-1 f 1 r-1 r 1 arrayFloor[b-1][f-1][r-1] + v arrayFloor[b-1][f-1][r-1] arrayFloor[b-1][f-1] arrayFloor[b-1] arrayFloor b-1 b 1 f-1 f 1 r-1 r 1 v {
			arrayFloor[b-1][f-1][r-1] = v;
		} arrayFloor[b-1][f-1][r-1] = v arrayFloor[b-1][f-1][r-1] arrayFloor[b-1][f-1] arrayFloor[b-1] arrayFloor b-1 b 1 f-1 f 1 r-1 r 1 v int b b int f f int r r int v v public class Main{

	static int[][][] arrayFloor = new int[4][3][10];

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();

		//??????????????????
		for(int k = 0; k < 4; k++) {
			for(int i = 0; i < 3; i++) {
				for(int j = 0; j < 10; j++) {
					arrayFloor[k][i][j] = 0;
				}
			}
		}

		for(int i = 0; i < A; i++) {

			int b = sc.nextInt();
			int f = sc.nextInt();
			int r = sc.nextInt();
			int v = sc.nextInt();

			switch(b) {
			case 1:
				calculate(b, f, r, v);
				break;

			case 2:
				calculate(b, f, r, v);
				break;

			case 3:
				calculate(b, f, r, v);
				break;

			case 4:
				calculate(b, f, r, v);
				break;
			}

		}

		for(int k = 0; k < 4; k++) {
			for(int i = 0; i < 3; i++) {
				for(int j = 0; j < 10; j++) {
					System.out.print(" "+arrayFloor[k][i][j]);
				}
				System.out.println("");
			}
			if(!(k == 3)) {
				System.out.println("####################");
			}
		}


	}
	public static void calculate(int b, int f, int r, int v) {

		if(arrayFloor[b-1][f-1][r-1] != 0) {
			arrayFloor[b-1][f-1][r-1] = arrayFloor[b-1][f-1][r-1] + v;
		}
		else {
			arrayFloor[b-1][f-1][r-1] = v;
		}
	}
} public class Main{

	static int[][][] arrayFloor = new int[4][3][10];

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();

		//??????????????????
		for(int k = 0; k < 4; k++) {
			for(int i = 0; i < 3; i++) {
				for(int j = 0; j < 10; j++) {
					arrayFloor[k][i][j] = 0;
				}
			}
		}

		for(int i = 0; i < A; i++) {

			int b = sc.nextInt();
			int f = sc.nextInt();
			int r = sc.nextInt();
			int v = sc.nextInt();

			switch(b) {
			case 1:
				calculate(b, f, r, v);
				break;

			case 2:
				calculate(b, f, r, v);
				break;

			case 3:
				calculate(b, f, r, v);
				break;

			case 4:
				calculate(b, f, r, v);
				break;
			}

		}

		for(int k = 0; k < 4; k++) {
			for(int i = 0; i < 3; i++) {
				for(int j = 0; j < 10; j++) {
					System.out.print(" "+arrayFloor[k][i][j]);
				}
				System.out.println("");
			}
			if(!(k == 3)) {
				System.out.println("####################");
			}
		}


	}
	public static void calculate(int b, int f, int r, int v) {

		if(arrayFloor[b-1][f-1][r-1] != 0) {
			arrayFloor[b-1][f-1][r-1] = arrayFloor[b-1][f-1][r-1] + v;
		}
		else {
			arrayFloor[b-1][f-1][r-1] = v;
		}
	}
} Main
import java.util.Scanner;

public class Main{

	static int[][][] arrayFloor = new int[4][3][10];

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();

		//??????????????????
		for(int k = 0; k < 4; k++) {
			for(int i = 0; i < 3; i++) {
				for(int j = 0; j < 10; j++) {
					arrayFloor[k][i][j] = 0;
				}
			}
		}

		for(int i = 0; i < A; i++) {

			int b = sc.nextInt();
			int f = sc.nextInt();
			int r = sc.nextInt();
			int v = sc.nextInt();

			switch(b) {
			case 1:
				calculate(b, f, r, v);
				break;

			case 2:
				calculate(b, f, r, v);
				break;

			case 3:
				calculate(b, f, r, v);
				break;

			case 4:
				calculate(b, f, r, v);
				break;
			}

		}

		for(int k = 0; k < 4; k++) {
			for(int i = 0; i < 3; i++) {
				for(int j = 0; j < 10; j++) {
					System.out.print(" "+arrayFloor[k][i][j]);
				}
				System.out.println("");
			}
			if(!(k == 3)) {
				System.out.println("####################");
			}
		}


	}
	public static void calculate(int b, int f, int r, int v) {

		if(arrayFloor[b-1][f-1][r-1] != 0) {
			arrayFloor[b-1][f-1][r-1] = arrayFloor[b-1][f-1][r-1] + v;
		}
		else {
			arrayFloor[b-1][f-1][r-1] = v;
		}
	}
}