import java.util.*;

public class Main{
	public static void main(String[] args){
		int[][][] people = new int[4][3][10];
		for(int i = 0; i < 4; i++){
			for(int j = 0; j < 3; j++){
				for(int k = 0; k < 10; k++){
					people[i][j][k] = 0;
				}
			}
		}

		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		for(int h = 0; h < n; h++){
			int b = scan.nextInt();
			int f = scan.nextInt();
			int r = scan.nextInt();
			int v = scan.nextInt();
			people[b - 1][f - 1][r - 1] += 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", people[i][j][k]);
				}
				System.out.println("");
			}
			if(i != 3){
				StringBuilder sb = new StringBuilder();
				for(int k = 0; k < 20; k++){
					sb.append("#");
				}
				String str = sb.toString();
				System.out.println(str);
			}
		}
	}
} import java.util.*; util.* java public class Main{
	public static void main(String[] args){
		int[][][] people = new int[4][3][10];
		for(int i = 0; i < 4; i++){
			for(int j = 0; j < 3; j++){
				for(int k = 0; k < 10; k++){
					people[i][j][k] = 0;
				}
			}
		}

		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		for(int h = 0; h < n; h++){
			int b = scan.nextInt();
			int f = scan.nextInt();
			int r = scan.nextInt();
			int v = scan.nextInt();
			people[b - 1][f - 1][r - 1] += 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", people[i][j][k]);
				}
				System.out.println("");
			}
			if(i != 3){
				StringBuilder sb = new StringBuilder();
				for(int k = 0; k < 20; k++){
					sb.append("#");
				}
				String str = sb.toString();
				System.out.println(str);
			}
		}
	}
} Main public static void main(String[] args){
		int[][][] people = new int[4][3][10];
		for(int i = 0; i < 4; i++){
			for(int j = 0; j < 3; j++){
				for(int k = 0; k < 10; k++){
					people[i][j][k] = 0;
				}
			}
		}

		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		for(int h = 0; h < n; h++){
			int b = scan.nextInt();
			int f = scan.nextInt();
			int r = scan.nextInt();
			int v = scan.nextInt();
			people[b - 1][f - 1][r - 1] += 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", people[i][j][k]);
				}
				System.out.println("");
			}
			if(i != 3){
				StringBuilder sb = new StringBuilder();
				for(int k = 0; k < 20; k++){
					sb.append("#");
				}
				String str = sb.toString();
				System.out.println(str);
			}
		}
	} main {
		int[][][] people = new int[4][3][10];
		for(int i = 0; i < 4; i++){
			for(int j = 0; j < 3; j++){
				for(int k = 0; k < 10; k++){
					people[i][j][k] = 0;
				}
			}
		}

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

		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		for(int h = 0; h < n; h++){
			int b = scan.nextInt();
			int f = scan.nextInt();
			int r = scan.nextInt();
			int v = scan.nextInt();
			people[b - 1][f - 1][r - 1] += 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", people[i][j][k]);
				}
				System.out.println("");
			}
			if(i != 3){
				StringBuilder sb = new StringBuilder();
				for(int k = 0; k < 20; k++){
					sb.append("#");
				}
				String str = sb.toString();
				System.out.println(str);
			}
		}
	}
} public class Main{
	public static void main(String[] args){
		int[][][] people = new int[4][3][10];
		for(int i = 0; i < 4; i++){
			for(int j = 0; j < 3; j++){
				for(int k = 0; k < 10; k++){
					people[i][j][k] = 0;
				}
			}
		}

		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		for(int h = 0; h < n; h++){
			int b = scan.nextInt();
			int f = scan.nextInt();
			int r = scan.nextInt();
			int v = scan.nextInt();
			people[b - 1][f - 1][r - 1] += 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", people[i][j][k]);
				}
				System.out.println("");
			}
			if(i != 3){
				StringBuilder sb = new StringBuilder();
				for(int k = 0; k < 20; k++){
					sb.append("#");
				}
				String str = sb.toString();
				System.out.println(str);
			}
		}
	}
} Main
import java.util.*;

public class Main{
	public static void main(String[] args){
		int[][][] people = new int[4][3][10];
		for(int i = 0; i < 4; i++){
			for(int j = 0; j < 3; j++){
				for(int k = 0; k < 10; k++){
					people[i][j][k] = 0;
				}
			}
		}

		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		for(int h = 0; h < n; h++){
			int b = scan.nextInt();
			int f = scan.nextInt();
			int r = scan.nextInt();
			int v = scan.nextInt();
			people[b - 1][f - 1][r - 1] += 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", people[i][j][k]);
				}
				System.out.println("");
			}
			if(i != 3){
				StringBuilder sb = new StringBuilder();
				for(int k = 0; k < 20; k++){
					sb.append("#");
				}
				String str = sb.toString();
				System.out.println(str);
			}
		}
	}
}