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

public class Main {

	public static final int BIG_NUM  = 2000000000;
	public static final int MOD  = 1000000007;

	public static void main(String[] args) {

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String work[] = new String[4];
		int table[][][] = new int[4][3][10];

		for(int a = 0; a < 4; a++){
			for(int b = 0; b < 3; b++){
				for(int c = 0; c < 10; c++)table[a][b][c] = 0;
			}
		}

		try {
			int N = Integer.parseInt(br.readLine());

			for(int loop = 0; loop < N; loop++){
				work = br.readLine().split("\\s+");
				table[Integer.parseInt(work[0])-1][Integer.parseInt(work[1])-1][Integer.parseInt(work[2])-1] += Integer.parseInt(work[3]);
			}


			print(table[0]);
			for(int i = 1; i <= 3; i++){
				System.out.printf("####################\n");
				print(table[i]);
			}

		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	private static void print(int house[][]){

		for(int row = 0; row < 3; row++){
			for(int col = 0; col < 10; col++){
				System.out.printf(" %d", house[row][col]);
			}
			System.out.printf("\n");
		}
	}
}

 import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {

	public static final int BIG_NUM  = 2000000000;
	public static final int MOD  = 1000000007;

	public static void main(String[] args) {

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String work[] = new String[4];
		int table[][][] = new int[4][3][10];

		for(int a = 0; a < 4; a++){
			for(int b = 0; b < 3; b++){
				for(int c = 0; c < 10; c++)table[a][b][c] = 0;
			}
		}

		try {
			int N = Integer.parseInt(br.readLine());

			for(int loop = 0; loop < N; loop++){
				work = br.readLine().split("\\s+");
				table[Integer.parseInt(work[0])-1][Integer.parseInt(work[1])-1][Integer.parseInt(work[2])-1] += Integer.parseInt(work[3]);
			}


			print(table[0]);
			for(int i = 1; i <= 3; i++){
				System.out.printf("####################\n");
				print(table[i]);
			}

		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	private static void print(int house[][]){

		for(int row = 0; row < 3; row++){
			for(int col = 0; col < 10; col++){
				System.out.printf(" %d", house[row][col]);
			}
			System.out.printf("\n");
		}
	}
} Main public static final int BIG_NUM  = 2000000000; BIG_NUM 2000000000 public static final int MOD  = 1000000007; MOD 1000000007 public static void main(String[] args) {

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String work[] = new String[4];
		int table[][][] = new int[4][3][10];

		for(int a = 0; a < 4; a++){
			for(int b = 0; b < 3; b++){
				for(int c = 0; c < 10; c++)table[a][b][c] = 0;
			}
		}

		try {
			int N = Integer.parseInt(br.readLine());

			for(int loop = 0; loop < N; loop++){
				work = br.readLine().split("\\s+");
				table[Integer.parseInt(work[0])-1][Integer.parseInt(work[1])-1][Integer.parseInt(work[2])-1] += Integer.parseInt(work[3]);
			}


			print(table[0]);
			for(int i = 1; i <= 3; i++){
				System.out.printf("####################\n");
				print(table[i]);
			}

		} catch (Exception e) {
			e.printStackTrace();
		}
	} main {

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String work[] = new String[4];
		int table[][][] = new int[4][3][10];

		for(int a = 0; a < 4; a++){
			for(int b = 0; b < 3; b++){
				for(int c = 0; c < 10; c++)table[a][b][c] = 0;
			}
		}

		try {
			int N = Integer.parseInt(br.readLine());

			for(int loop = 0; loop < N; loop++){
				work = br.readLine().split("\\s+");
				table[Integer.parseInt(work[0])-1][Integer.parseInt(work[1])-1][Integer.parseInt(work[2])-1] += Integer.parseInt(work[3]);
			}


			print(table[0]);
			for(int i = 1; i <= 3; i++){
				System.out.printf("####################\n");
				print(table[i]);
			}

		} catch (Exception e) {
			e.printStackTrace();
		}
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String work[] = new String[4]; work new String[4] 4 int table[][][] = new int[4][3][10]; table new int[4][3][10] 4 3 10 for(int a = 0; a < 4; a++){
			for(int b = 0; b < 3; b++){
				for(int c = 0; c < 10; c++)table[a][b][c] = 0;
			}
		} int a = 0; int a = 0; a 0 a < 4 a 4 a++ a++ a {
			for(int b = 0; b < 3; b++){
				for(int c = 0; c < 10; c++)table[a][b][c] = 0;
			}
		} {
			for(int b = 0; b < 3; b++){
				for(int c = 0; c < 10; c++)table[a][b][c] = 0;
			}
		} for(int b = 0; b < 3; b++){
				for(int c = 0; c < 10; c++)table[a][b][c] = 0;
			} int b = 0; int b = 0; b 0 b < 3 b 3 b++ b++ b {
				for(int c = 0; c < 10; c++)table[a][b][c] = 0;
			} {
				for(int c = 0; c < 10; c++)table[a][b][c] = 0;
			} for(int c = 0; c < 10; c++)table[a][b][c] = 0; int c = 0; int c = 0; c 0 c < 10 c 10 c++ c++ c table[a][b][c] = 0; table[a][b][c] = 0 table[a][b][c] table[a][b] table[a] table a b c 0 try {
			int N = Integer.parseInt(br.readLine());

			for(int loop = 0; loop < N; loop++){
				work = br.readLine().split("\\s+");
				table[Integer.parseInt(work[0])-1][Integer.parseInt(work[1])-1][Integer.parseInt(work[2])-1] += Integer.parseInt(work[3]);
			}


			print(table[0]);
			for(int i = 1; i <= 3; i++){
				System.out.printf("####################\n");
				print(table[i]);
			}

		} catch (Exception e) {
			e.printStackTrace();
		} catch (Exception e) {
			e.printStackTrace();
		} Exception e {
			e.printStackTrace();
		} e.printStackTrace() e.printStackTrace e {
			int N = Integer.parseInt(br.readLine());

			for(int loop = 0; loop < N; loop++){
				work = br.readLine().split("\\s+");
				table[Integer.parseInt(work[0])-1][Integer.parseInt(work[1])-1][Integer.parseInt(work[2])-1] += Integer.parseInt(work[3]);
			}


			print(table[0]);
			for(int i = 1; i <= 3; i++){
				System.out.printf("####################\n");
				print(table[i]);
			}

		} int N = Integer.parseInt(br.readLine()); N Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br for(int loop = 0; loop < N; loop++){
				work = br.readLine().split("\\s+");
				table[Integer.parseInt(work[0])-1][Integer.parseInt(work[1])-1][Integer.parseInt(work[2])-1] += Integer.parseInt(work[3]);
			} int loop = 0; int loop = 0; loop 0 loop < N loop N loop++ loop++ loop {
				work = br.readLine().split("\\s+");
				table[Integer.parseInt(work[0])-1][Integer.parseInt(work[1])-1][Integer.parseInt(work[2])-1] += Integer.parseInt(work[3]);
			} {
				work = br.readLine().split("\\s+");
				table[Integer.parseInt(work[0])-1][Integer.parseInt(work[1])-1][Integer.parseInt(work[2])-1] += Integer.parseInt(work[3]);
			} work = br.readLine().split("\\s+") work br.readLine().split("\\s+") br.readLine().split br.readLine() br.readLine br "\\s+" table[Integer.parseInt(work[0])-1][Integer.parseInt(work[1])-1][Integer.parseInt(work[2])-1] += Integer.parseInt(work[3]) table[Integer.parseInt(work[0])-1][Integer.parseInt(work[1])-1][Integer.parseInt(work[2])-1] table[Integer.parseInt(work[0])-1][Integer.parseInt(work[1])-1] table[Integer.parseInt(work[0])-1] table Integer.parseInt(work[0])-1 Integer.parseInt(work[0]) Integer.parseInt Integer work[0] work 0 1 Integer.parseInt(work[1])-1 Integer.parseInt(work[1]) Integer.parseInt Integer work[1] work 1 1 Integer.parseInt(work[2])-1 Integer.parseInt(work[2]) Integer.parseInt Integer work[2] work 2 1 Integer.parseInt(work[3]) Integer.parseInt Integer work[3] work 3 print(table[0]) print table[0] table 0 for(int i = 1; i <= 3; i++){
				System.out.printf("####################\n");
				print(table[i]);
			} int i = 1; int i = 1; i 1 i <= 3 i 3 i++ i++ i {
				System.out.printf("####################\n");
				print(table[i]);
			} {
				System.out.printf("####################\n");
				print(table[i]);
			} System.out.printf("####################\n") System.out.printf System.out System System.out "####################\n" print(table[i]) print table[i] table i String[] args args private static void print(int house[][]){

		for(int row = 0; row < 3; row++){
			for(int col = 0; col < 10; col++){
				System.out.printf(" %d", house[row][col]);
			}
			System.out.printf("\n");
		}
	} print {

		for(int row = 0; row < 3; row++){
			for(int col = 0; col < 10; col++){
				System.out.printf(" %d", house[row][col]);
			}
			System.out.printf("\n");
		}
	} for(int row = 0; row < 3; row++){
			for(int col = 0; col < 10; col++){
				System.out.printf(" %d", house[row][col]);
			}
			System.out.printf("\n");
		} int row = 0; int row = 0; row 0 row < 3 row 3 row++ row++ row {
			for(int col = 0; col < 10; col++){
				System.out.printf(" %d", house[row][col]);
			}
			System.out.printf("\n");
		} {
			for(int col = 0; col < 10; col++){
				System.out.printf(" %d", house[row][col]);
			}
			System.out.printf("\n");
		} for(int col = 0; col < 10; col++){
				System.out.printf(" %d", house[row][col]);
			} int col = 0; int col = 0; col 0 col < 10 col 10 col++ col++ col {
				System.out.printf(" %d", house[row][col]);
			} {
				System.out.printf(" %d", house[row][col]);
			} System.out.printf(" %d", house[row][col]) System.out.printf System.out System System.out " %d" house[row][col] house[row] house row col System.out.printf("\n") System.out.printf System.out System System.out "\n" int house[][] house public class Main {

	public static final int BIG_NUM  = 2000000000;
	public static final int MOD  = 1000000007;

	public static void main(String[] args) {

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String work[] = new String[4];
		int table[][][] = new int[4][3][10];

		for(int a = 0; a < 4; a++){
			for(int b = 0; b < 3; b++){
				for(int c = 0; c < 10; c++)table[a][b][c] = 0;
			}
		}

		try {
			int N = Integer.parseInt(br.readLine());

			for(int loop = 0; loop < N; loop++){
				work = br.readLine().split("\\s+");
				table[Integer.parseInt(work[0])-1][Integer.parseInt(work[1])-1][Integer.parseInt(work[2])-1] += Integer.parseInt(work[3]);
			}


			print(table[0]);
			for(int i = 1; i <= 3; i++){
				System.out.printf("####################\n");
				print(table[i]);
			}

		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	private static void print(int house[][]){

		for(int row = 0; row < 3; row++){
			for(int col = 0; col < 10; col++){
				System.out.printf(" %d", house[row][col]);
			}
			System.out.printf("\n");
		}
	}
} public class Main {

	public static final int BIG_NUM  = 2000000000;
	public static final int MOD  = 1000000007;

	public static void main(String[] args) {

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String work[] = new String[4];
		int table[][][] = new int[4][3][10];

		for(int a = 0; a < 4; a++){
			for(int b = 0; b < 3; b++){
				for(int c = 0; c < 10; c++)table[a][b][c] = 0;
			}
		}

		try {
			int N = Integer.parseInt(br.readLine());

			for(int loop = 0; loop < N; loop++){
				work = br.readLine().split("\\s+");
				table[Integer.parseInt(work[0])-1][Integer.parseInt(work[1])-1][Integer.parseInt(work[2])-1] += Integer.parseInt(work[3]);
			}


			print(table[0]);
			for(int i = 1; i <= 3; i++){
				System.out.printf("####################\n");
				print(table[i]);
			}

		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	private static void print(int house[][]){

		for(int row = 0; row < 3; row++){
			for(int col = 0; col < 10; col++){
				System.out.printf(" %d", house[row][col]);
			}
			System.out.printf("\n");
		}
	}
} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {

	public static final int BIG_NUM  = 2000000000;
	public static final int MOD  = 1000000007;

	public static void main(String[] args) {

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String work[] = new String[4];
		int table[][][] = new int[4][3][10];

		for(int a = 0; a < 4; a++){
			for(int b = 0; b < 3; b++){
				for(int c = 0; c < 10; c++)table[a][b][c] = 0;
			}
		}

		try {
			int N = Integer.parseInt(br.readLine());

			for(int loop = 0; loop < N; loop++){
				work = br.readLine().split("\\s+");
				table[Integer.parseInt(work[0])-1][Integer.parseInt(work[1])-1][Integer.parseInt(work[2])-1] += Integer.parseInt(work[3]);
			}


			print(table[0]);
			for(int i = 1; i <= 3; i++){
				System.out.printf("####################\n");
				print(table[i]);
			}

		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	private static void print(int house[][]){

		for(int row = 0; row < 3; row++){
			for(int col = 0; col < 10; col++){
				System.out.printf(" %d", house[row][col]);
			}
			System.out.printf("\n");
		}
	}
}


