import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

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

		Scanner scan = new Scanner(System.in);

		int n = scan.nextInt();

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

			man_num[b - 1][f - 1][r - 1] = man_num[b - 1][f - 1][r - 1] + v;
		}
		
		
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 10; j++) {
				System.out.print(" "+man_num[0][i][j]);
			}
			System.out.println();
		}
		
		for (int i = 0; i < 1; i++) {
			for (int j = 0; j < 20; j++) {
				System.out.print("#");
			}
			System.out.println();
		}
		
		
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 10; j++) {
				System.out.print(" "+man_num[1][i][j]);
			}
			System.out.println();
		}
		
		for (int i = 0; i < 1; i++) {
			for (int j = 0; j < 20; j++) {
				System.out.print("#");
			}
			System.out.println();
		}
		
		
		
		
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 10; j++) {
				System.out.print(" "+man_num[2][i][j]);
			}
			System.out.println();
		}
		
		for (int i = 0; i < 1; i++) {
			for (int j = 0; j < 20; j++) {
				System.out.print("#");
			}
			System.out.println();
		}
		
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 10; j++) {
				System.out.print(" "+man_num[3][i][j]);
			}
			System.out.println();
		}
		
		
		
	}

} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {

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

		Scanner scan = new Scanner(System.in);

		int n = scan.nextInt();

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

			man_num[b - 1][f - 1][r - 1] = man_num[b - 1][f - 1][r - 1] + v;
		}
		
		
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 10; j++) {
				System.out.print(" "+man_num[0][i][j]);
			}
			System.out.println();
		}
		
		for (int i = 0; i < 1; i++) {
			for (int j = 0; j < 20; j++) {
				System.out.print("#");
			}
			System.out.println();
		}
		
		
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 10; j++) {
				System.out.print(" "+man_num[1][i][j]);
			}
			System.out.println();
		}
		
		for (int i = 0; i < 1; i++) {
			for (int j = 0; j < 20; j++) {
				System.out.print("#");
			}
			System.out.println();
		}
		
		
		
		
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 10; j++) {
				System.out.print(" "+man_num[2][i][j]);
			}
			System.out.println();
		}
		
		for (int i = 0; i < 1; i++) {
			for (int j = 0; j < 20; j++) {
				System.out.print("#");
			}
			System.out.println();
		}
		
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 10; j++) {
				System.out.print(" "+man_num[3][i][j]);
			}
			System.out.println();
		}
		
		
		
	}

} Main public static void main(String[] args) {

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

		Scanner scan = new Scanner(System.in);

		int n = scan.nextInt();

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

			man_num[b - 1][f - 1][r - 1] = man_num[b - 1][f - 1][r - 1] + v;
		}
		
		
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 10; j++) {
				System.out.print(" "+man_num[0][i][j]);
			}
			System.out.println();
		}
		
		for (int i = 0; i < 1; i++) {
			for (int j = 0; j < 20; j++) {
				System.out.print("#");
			}
			System.out.println();
		}
		
		
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 10; j++) {
				System.out.print(" "+man_num[1][i][j]);
			}
			System.out.println();
		}
		
		for (int i = 0; i < 1; i++) {
			for (int j = 0; j < 20; j++) {
				System.out.print("#");
			}
			System.out.println();
		}
		
		
		
		
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 10; j++) {
				System.out.print(" "+man_num[2][i][j]);
			}
			System.out.println();
		}
		
		for (int i = 0; i < 1; i++) {
			for (int j = 0; j < 20; j++) {
				System.out.print("#");
			}
			System.out.println();
		}
		
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 10; j++) {
				System.out.print(" "+man_num[3][i][j]);
			}
			System.out.println();
		}
		
		
		
	} main {

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

		Scanner scan = new Scanner(System.in);

		int n = scan.nextInt();

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

			man_num[b - 1][f - 1][r - 1] = man_num[b - 1][f - 1][r - 1] + v;
		}
		
		
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 10; j++) {
				System.out.print(" "+man_num[0][i][j]);
			}
			System.out.println();
		}
		
		for (int i = 0; i < 1; i++) {
			for (int j = 0; j < 20; j++) {
				System.out.print("#");
			}
			System.out.println();
		}
		
		
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 10; j++) {
				System.out.print(" "+man_num[1][i][j]);
			}
			System.out.println();
		}
		
		for (int i = 0; i < 1; i++) {
			for (int j = 0; j < 20; j++) {
				System.out.print("#");
			}
			System.out.println();
		}
		
		
		
		
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 10; j++) {
				System.out.print(" "+man_num[2][i][j]);
			}
			System.out.println();
		}
		
		for (int i = 0; i < 1; i++) {
			for (int j = 0; j < 20; j++) {
				System.out.print("#");
			}
			System.out.println();
		}
		
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 10; j++) {
				System.out.print(" "+man_num[3][i][j]);
			}
			System.out.println();
		}
		
		
		
	} int[][][] man_num; man_num man_num = new int[4][3][10] man_num new int[4][3][10] 4 3 10 Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan for (int i = 0; i < n; i++) {
			int b = scan.nextInt();
			int f = scan.nextInt();
			int r = scan.nextInt();
			int v = scan.nextInt();

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

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

			man_num[b - 1][f - 1][r - 1] = man_num[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 man_num[b - 1][f - 1][r - 1] = man_num[b - 1][f - 1][r - 1] + v man_num[b - 1][f - 1][r - 1] man_num[b - 1][f - 1] man_num[b - 1] man_num b - 1 b 1 f - 1 f 1 r - 1 r 1 man_num[b - 1][f - 1][r - 1] + v man_num[b - 1][f - 1][r - 1] man_num[b - 1][f - 1] man_num[b - 1] man_num b - 1 b 1 f - 1 f 1 r - 1 r 1 v for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 10; j++) {
				System.out.print(" "+man_num[0][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(" "+man_num[0][i][j]);
			}
			System.out.println();
		} {
			for (int j = 0; j < 10; j++) {
				System.out.print(" "+man_num[0][i][j]);
			}
			System.out.println();
		} for (int j = 0; j < 10; j++) {
				System.out.print(" "+man_num[0][i][j]);
			} int j = 0; int j = 0; j 0 j < 10 j 10 j++ j++ j {
				System.out.print(" "+man_num[0][i][j]);
			} {
				System.out.print(" "+man_num[0][i][j]);
			} System.out.print(" "+man_num[0][i][j]) System.out.print System.out System System.out " "+man_num[0][i][j] " " man_num[0][i][j] man_num[0][i] man_num[0] man_num 0 i j System.out.println() System.out.println System.out System System.out for (int i = 0; i < 1; i++) {
			for (int j = 0; j < 20; j++) {
				System.out.print("#");
			}
			System.out.println();
		} int i = 0; int i = 0; i 0 i < 1 i 1 i++ i++ i {
			for (int j = 0; j < 20; j++) {
				System.out.print("#");
			}
			System.out.println();
		} {
			for (int j = 0; j < 20; j++) {
				System.out.print("#");
			}
			System.out.println();
		} for (int j = 0; j < 20; j++) {
				System.out.print("#");
			} int j = 0; int j = 0; j 0 j < 20 j 20 j++ j++ j {
				System.out.print("#");
			} {
				System.out.print("#");
			} System.out.print("#") System.out.print System.out System System.out "#" System.out.println() System.out.println System.out System System.out for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 10; j++) {
				System.out.print(" "+man_num[1][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(" "+man_num[1][i][j]);
			}
			System.out.println();
		} {
			for (int j = 0; j < 10; j++) {
				System.out.print(" "+man_num[1][i][j]);
			}
			System.out.println();
		} for (int j = 0; j < 10; j++) {
				System.out.print(" "+man_num[1][i][j]);
			} int j = 0; int j = 0; j 0 j < 10 j 10 j++ j++ j {
				System.out.print(" "+man_num[1][i][j]);
			} {
				System.out.print(" "+man_num[1][i][j]);
			} System.out.print(" "+man_num[1][i][j]) System.out.print System.out System System.out " "+man_num[1][i][j] " " man_num[1][i][j] man_num[1][i] man_num[1] man_num 1 i j System.out.println() System.out.println System.out System System.out for (int i = 0; i < 1; i++) {
			for (int j = 0; j < 20; j++) {
				System.out.print("#");
			}
			System.out.println();
		} int i = 0; int i = 0; i 0 i < 1 i 1 i++ i++ i {
			for (int j = 0; j < 20; j++) {
				System.out.print("#");
			}
			System.out.println();
		} {
			for (int j = 0; j < 20; j++) {
				System.out.print("#");
			}
			System.out.println();
		} for (int j = 0; j < 20; j++) {
				System.out.print("#");
			} int j = 0; int j = 0; j 0 j < 20 j 20 j++ j++ j {
				System.out.print("#");
			} {
				System.out.print("#");
			} System.out.print("#") System.out.print System.out System System.out "#" System.out.println() System.out.println System.out System System.out for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 10; j++) {
				System.out.print(" "+man_num[2][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(" "+man_num[2][i][j]);
			}
			System.out.println();
		} {
			for (int j = 0; j < 10; j++) {
				System.out.print(" "+man_num[2][i][j]);
			}
			System.out.println();
		} for (int j = 0; j < 10; j++) {
				System.out.print(" "+man_num[2][i][j]);
			} int j = 0; int j = 0; j 0 j < 10 j 10 j++ j++ j {
				System.out.print(" "+man_num[2][i][j]);
			} {
				System.out.print(" "+man_num[2][i][j]);
			} System.out.print(" "+man_num[2][i][j]) System.out.print System.out System System.out " "+man_num[2][i][j] " " man_num[2][i][j] man_num[2][i] man_num[2] man_num 2 i j System.out.println() System.out.println System.out System System.out for (int i = 0; i < 1; i++) {
			for (int j = 0; j < 20; j++) {
				System.out.print("#");
			}
			System.out.println();
		} int i = 0; int i = 0; i 0 i < 1 i 1 i++ i++ i {
			for (int j = 0; j < 20; j++) {
				System.out.print("#");
			}
			System.out.println();
		} {
			for (int j = 0; j < 20; j++) {
				System.out.print("#");
			}
			System.out.println();
		} for (int j = 0; j < 20; j++) {
				System.out.print("#");
			} int j = 0; int j = 0; j 0 j < 20 j 20 j++ j++ j {
				System.out.print("#");
			} {
				System.out.print("#");
			} System.out.print("#") System.out.print System.out System System.out "#" System.out.println() System.out.println System.out System System.out for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 10; j++) {
				System.out.print(" "+man_num[3][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(" "+man_num[3][i][j]);
			}
			System.out.println();
		} {
			for (int j = 0; j < 10; j++) {
				System.out.print(" "+man_num[3][i][j]);
			}
			System.out.println();
		} for (int j = 0; j < 10; j++) {
				System.out.print(" "+man_num[3][i][j]);
			} int j = 0; int j = 0; j 0 j < 10 j 10 j++ j++ j {
				System.out.print(" "+man_num[3][i][j]);
			} {
				System.out.print(" "+man_num[3][i][j]);
			} System.out.print(" "+man_num[3][i][j]) System.out.print System.out System System.out " "+man_num[3][i][j] " " man_num[3][i][j] man_num[3][i] man_num[3] man_num 3 i j System.out.println() System.out.println System.out System System.out String[] args args public class Main {

	public static void main(String[] args) {

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

		Scanner scan = new Scanner(System.in);

		int n = scan.nextInt();

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

			man_num[b - 1][f - 1][r - 1] = man_num[b - 1][f - 1][r - 1] + v;
		}
		
		
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 10; j++) {
				System.out.print(" "+man_num[0][i][j]);
			}
			System.out.println();
		}
		
		for (int i = 0; i < 1; i++) {
			for (int j = 0; j < 20; j++) {
				System.out.print("#");
			}
			System.out.println();
		}
		
		
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 10; j++) {
				System.out.print(" "+man_num[1][i][j]);
			}
			System.out.println();
		}
		
		for (int i = 0; i < 1; i++) {
			for (int j = 0; j < 20; j++) {
				System.out.print("#");
			}
			System.out.println();
		}
		
		
		
		
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 10; j++) {
				System.out.print(" "+man_num[2][i][j]);
			}
			System.out.println();
		}
		
		for (int i = 0; i < 1; i++) {
			for (int j = 0; j < 20; j++) {
				System.out.print("#");
			}
			System.out.println();
		}
		
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 10; j++) {
				System.out.print(" "+man_num[3][i][j]);
			}
			System.out.println();
		}
		
		
		
	}

} public class Main {

	public static void main(String[] args) {

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

		Scanner scan = new Scanner(System.in);

		int n = scan.nextInt();

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

			man_num[b - 1][f - 1][r - 1] = man_num[b - 1][f - 1][r - 1] + v;
		}
		
		
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 10; j++) {
				System.out.print(" "+man_num[0][i][j]);
			}
			System.out.println();
		}
		
		for (int i = 0; i < 1; i++) {
			for (int j = 0; j < 20; j++) {
				System.out.print("#");
			}
			System.out.println();
		}
		
		
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 10; j++) {
				System.out.print(" "+man_num[1][i][j]);
			}
			System.out.println();
		}
		
		for (int i = 0; i < 1; i++) {
			for (int j = 0; j < 20; j++) {
				System.out.print("#");
			}
			System.out.println();
		}
		
		
		
		
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 10; j++) {
				System.out.print(" "+man_num[2][i][j]);
			}
			System.out.println();
		}
		
		for (int i = 0; i < 1; i++) {
			for (int j = 0; j < 20; j++) {
				System.out.print("#");
			}
			System.out.println();
		}
		
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 10; j++) {
				System.out.print(" "+man_num[3][i][j]);
			}
			System.out.println();
		}
		
		
		
	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

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

		Scanner scan = new Scanner(System.in);

		int n = scan.nextInt();

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

			man_num[b - 1][f - 1][r - 1] = man_num[b - 1][f - 1][r - 1] + v;
		}
		
		
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 10; j++) {
				System.out.print(" "+man_num[0][i][j]);
			}
			System.out.println();
		}
		
		for (int i = 0; i < 1; i++) {
			for (int j = 0; j < 20; j++) {
				System.out.print("#");
			}
			System.out.println();
		}
		
		
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 10; j++) {
				System.out.print(" "+man_num[1][i][j]);
			}
			System.out.println();
		}
		
		for (int i = 0; i < 1; i++) {
			for (int j = 0; j < 20; j++) {
				System.out.print("#");
			}
			System.out.println();
		}
		
		
		
		
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 10; j++) {
				System.out.print(" "+man_num[2][i][j]);
			}
			System.out.println();
		}
		
		for (int i = 0; i < 1; i++) {
			for (int j = 0; j < 20; j++) {
				System.out.print("#");
			}
			System.out.println();
		}
		
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 10; j++) {
				System.out.print(" "+man_num[3][i][j]);
			}
			System.out.println();
		}
		
		
		
	}

}