import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();

		int[][][] data = new int[4][3][10];

		for(int i = 0; i < n; i++) {
			int b = scan.nextInt() - 1;
			int f = scan.nextInt() - 1;
			int r = scan.nextInt() - 1;
			int v = scan.nextInt();

			try {
				if(data[b][f][r] < 0 || 9 < data[b][f][r]) {
					throw new Exception();
				}
				data[b][f][r] += v;
			}
			catch(Exception e) {

			}
		}

		for(int i = 0; i < 4; i++) {
			for(int j = 0; j < 3; j++) {
				for(int k = 0; k < 10; k++) {
					System.out.printf(" %d", data[i][j][k]);
				}
				System.out.println();
			}
			if(i != 3) {
				System.out.println("####################");
			}
		}

		scan.close();
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();

		int[][][] data = new int[4][3][10];

		for(int i = 0; i < n; i++) {
			int b = scan.nextInt() - 1;
			int f = scan.nextInt() - 1;
			int r = scan.nextInt() - 1;
			int v = scan.nextInt();

			try {
				if(data[b][f][r] < 0 || 9 < data[b][f][r]) {
					throw new Exception();
				}
				data[b][f][r] += v;
			}
			catch(Exception e) {

			}
		}

		for(int i = 0; i < 4; i++) {
			for(int j = 0; j < 3; j++) {
				for(int k = 0; k < 10; k++) {
					System.out.printf(" %d", data[i][j][k]);
				}
				System.out.println();
			}
			if(i != 3) {
				System.out.println("####################");
			}
		}

		scan.close();
	}
} Main public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();

		int[][][] data = new int[4][3][10];

		for(int i = 0; i < n; i++) {
			int b = scan.nextInt() - 1;
			int f = scan.nextInt() - 1;
			int r = scan.nextInt() - 1;
			int v = scan.nextInt();

			try {
				if(data[b][f][r] < 0 || 9 < data[b][f][r]) {
					throw new Exception();
				}
				data[b][f][r] += v;
			}
			catch(Exception e) {

			}
		}

		for(int i = 0; i < 4; i++) {
			for(int j = 0; j < 3; j++) {
				for(int k = 0; k < 10; k++) {
					System.out.printf(" %d", data[i][j][k]);
				}
				System.out.println();
			}
			if(i != 3) {
				System.out.println("####################");
			}
		}

		scan.close();
	} main {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();

		int[][][] data = new int[4][3][10];

		for(int i = 0; i < n; i++) {
			int b = scan.nextInt() - 1;
			int f = scan.nextInt() - 1;
			int r = scan.nextInt() - 1;
			int v = scan.nextInt();

			try {
				if(data[b][f][r] < 0 || 9 < data[b][f][r]) {
					throw new Exception();
				}
				data[b][f][r] += v;
			}
			catch(Exception e) {

			}
		}

		for(int i = 0; i < 4; i++) {
			for(int j = 0; j < 3; j++) {
				for(int k = 0; k < 10; k++) {
					System.out.printf(" %d", data[i][j][k]);
				}
				System.out.println();
			}
			if(i != 3) {
				System.out.println("####################");
			}
		}

		scan.close();
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan int[][][] data = new int[4][3][10]; data new int[4][3][10] 4 3 10 for(int i = 0; i < n; i++) {
			int b = scan.nextInt() - 1;
			int f = scan.nextInt() - 1;
			int r = scan.nextInt() - 1;
			int v = scan.nextInt();

			try {
				if(data[b][f][r] < 0 || 9 < data[b][f][r]) {
					throw new Exception();
				}
				data[b][f][r] += v;
			}
			catch(Exception e) {

			}
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			int b = scan.nextInt() - 1;
			int f = scan.nextInt() - 1;
			int r = scan.nextInt() - 1;
			int v = scan.nextInt();

			try {
				if(data[b][f][r] < 0 || 9 < data[b][f][r]) {
					throw new Exception();
				}
				data[b][f][r] += v;
			}
			catch(Exception e) {

			}
		} {
			int b = scan.nextInt() - 1;
			int f = scan.nextInt() - 1;
			int r = scan.nextInt() - 1;
			int v = scan.nextInt();

			try {
				if(data[b][f][r] < 0 || 9 < data[b][f][r]) {
					throw new Exception();
				}
				data[b][f][r] += v;
			}
			catch(Exception e) {

			}
		} int b = scan.nextInt() - 1; b scan.nextInt() - 1 scan.nextInt() scan.nextInt scan 1 int f = scan.nextInt() - 1; f scan.nextInt() - 1 scan.nextInt() scan.nextInt scan 1 int r = scan.nextInt() - 1; r scan.nextInt() - 1 scan.nextInt() scan.nextInt scan 1 int v = scan.nextInt(); v scan.nextInt() scan.nextInt scan try {
				if(data[b][f][r] < 0 || 9 < data[b][f][r]) {
					throw new Exception();
				}
				data[b][f][r] += v;
			}
			catch(Exception e) {

			} catch(Exception e) {

			} Exception e {

			} {
				if(data[b][f][r] < 0 || 9 < data[b][f][r]) {
					throw new Exception();
				}
				data[b][f][r] += v;
			} if(data[b][f][r] < 0 || 9 < data[b][f][r]) {
					throw new Exception();
				} data[b][f][r] < 0 || 9 < data[b][f][r] data[b][f][r] < 0 data[b][f][r] data[b][f] data[b] data b f r 0 9 < data[b][f][r] 9 data[b][f][r] data[b][f] data[b] data b f r {
					throw new Exception();
				} throw new Exception(); new Exception() data[b][f][r] += v data[b][f][r] data[b][f] data[b] data b f r v for(int i = 0; i < 4; i++) {
			for(int j = 0; j < 3; j++) {
				for(int k = 0; k < 10; k++) {
					System.out.printf(" %d", data[i][j][k]);
				}
				System.out.println();
			}
			if(i != 3) {
				System.out.println("####################");
			}
		} 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++) {
					System.out.printf(" %d", data[i][j][k]);
				}
				System.out.println();
			}
			if(i != 3) {
				System.out.println("####################");
			}
		} {
			for(int j = 0; j < 3; j++) {
				for(int k = 0; k < 10; k++) {
					System.out.printf(" %d", data[i][j][k]);
				}
				System.out.println();
			}
			if(i != 3) {
				System.out.println("####################");
			}
		} for(int j = 0; j < 3; j++) {
				for(int k = 0; k < 10; k++) {
					System.out.printf(" %d", data[i][j][k]);
				}
				System.out.println();
			} int j = 0; int j = 0; j 0 j < 3 j 3 j++ j++ j {
				for(int k = 0; k < 10; k++) {
					System.out.printf(" %d", data[i][j][k]);
				}
				System.out.println();
			} {
				for(int k = 0; k < 10; k++) {
					System.out.printf(" %d", data[i][j][k]);
				}
				System.out.println();
			} for(int k = 0; k < 10; k++) {
					System.out.printf(" %d", data[i][j][k]);
				} int k = 0; int k = 0; k 0 k < 10 k 10 k++ k++ k {
					System.out.printf(" %d", data[i][j][k]);
				} {
					System.out.printf(" %d", data[i][j][k]);
				} System.out.printf(" %d", data[i][j][k]) System.out.printf System.out System System.out " %d" data[i][j][k] data[i][j] data[i] data i j k System.out.println() System.out.println System.out System System.out if(i != 3) {
				System.out.println("####################");
			} i != 3 i 3 {
				System.out.println("####################");
			} System.out.println("####################") System.out.println System.out System System.out "####################" scan.close() scan.close scan String[] args args public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();

		int[][][] data = new int[4][3][10];

		for(int i = 0; i < n; i++) {
			int b = scan.nextInt() - 1;
			int f = scan.nextInt() - 1;
			int r = scan.nextInt() - 1;
			int v = scan.nextInt();

			try {
				if(data[b][f][r] < 0 || 9 < data[b][f][r]) {
					throw new Exception();
				}
				data[b][f][r] += v;
			}
			catch(Exception e) {

			}
		}

		for(int i = 0; i < 4; i++) {
			for(int j = 0; j < 3; j++) {
				for(int k = 0; k < 10; k++) {
					System.out.printf(" %d", data[i][j][k]);
				}
				System.out.println();
			}
			if(i != 3) {
				System.out.println("####################");
			}
		}

		scan.close();
	}
} public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();

		int[][][] data = new int[4][3][10];

		for(int i = 0; i < n; i++) {
			int b = scan.nextInt() - 1;
			int f = scan.nextInt() - 1;
			int r = scan.nextInt() - 1;
			int v = scan.nextInt();

			try {
				if(data[b][f][r] < 0 || 9 < data[b][f][r]) {
					throw new Exception();
				}
				data[b][f][r] += v;
			}
			catch(Exception e) {

			}
		}

		for(int i = 0; i < 4; i++) {
			for(int j = 0; j < 3; j++) {
				for(int k = 0; k < 10; k++) {
					System.out.printf(" %d", data[i][j][k]);
				}
				System.out.println();
			}
			if(i != 3) {
				System.out.println("####################");
			}
		}

		scan.close();
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();

		int[][][] data = new int[4][3][10];

		for(int i = 0; i < n; i++) {
			int b = scan.nextInt() - 1;
			int f = scan.nextInt() - 1;
			int r = scan.nextInt() - 1;
			int v = scan.nextInt();

			try {
				if(data[b][f][r] < 0 || 9 < data[b][f][r]) {
					throw new Exception();
				}
				data[b][f][r] += v;
			}
			catch(Exception e) {

			}
		}

		for(int i = 0; i < 4; i++) {
			for(int j = 0; j < 3; j++) {
				for(int k = 0; k < 10; k++) {
					System.out.printf(" %d", data[i][j][k]);
				}
				System.out.println();
			}
			if(i != 3) {
				System.out.println("####################");
			}
		}

		scan.close();
	}
}
