import java.io.*;
import java.util.Arrays;

public class Main{
	public static void main(String[] args) throws IOException{ 
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String sc = br.readLine();
		int n = Integer.parseInt(sc);
		int[][][] con = new int[4][3][10];
		for (int i = 0; i<n ; i++ ) {
			String line = br.readLine();
			String[] split = line.split(" ");
			int building = Integer.parseInt(split[0]);
			int floor = Integer.parseInt(split[1]);
			int rank = Integer.parseInt(split[2]);
			int mem = Integer.parseInt(split[3]);
			con[(building-1)][(floor-1)][(rank-1)] += mem;

		}
		for (int i = 0; i<4 ; i++ ) {
			for (int j = 0; j < 3  ;j++ ) {
				for (int k = 0; k < 10 ; k++ ) {
					if ( k == 9) {
						System.out.print(" " + con[i][j][k] +"\n");
					}else{

					System.out.print(" " +con[i][j][k]);
					}
				}
			}
			if (i < 3) {
			System.out.println("####################");
			}
		}
	}
} import java.io.*; io.* java import java.util.Arrays; Arrays java.util public class Main{
	public static void main(String[] args) throws IOException{ 
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String sc = br.readLine();
		int n = Integer.parseInt(sc);
		int[][][] con = new int[4][3][10];
		for (int i = 0; i<n ; i++ ) {
			String line = br.readLine();
			String[] split = line.split(" ");
			int building = Integer.parseInt(split[0]);
			int floor = Integer.parseInt(split[1]);
			int rank = Integer.parseInt(split[2]);
			int mem = Integer.parseInt(split[3]);
			con[(building-1)][(floor-1)][(rank-1)] += mem;

		}
		for (int i = 0; i<4 ; i++ ) {
			for (int j = 0; j < 3  ;j++ ) {
				for (int k = 0; k < 10 ; k++ ) {
					if ( k == 9) {
						System.out.print(" " + con[i][j][k] +"\n");
					}else{

					System.out.print(" " +con[i][j][k]);
					}
				}
			}
			if (i < 3) {
			System.out.println("####################");
			}
		}
	}
} Main public static void main(String[] args) throws IOException{ 
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String sc = br.readLine();
		int n = Integer.parseInt(sc);
		int[][][] con = new int[4][3][10];
		for (int i = 0; i<n ; i++ ) {
			String line = br.readLine();
			String[] split = line.split(" ");
			int building = Integer.parseInt(split[0]);
			int floor = Integer.parseInt(split[1]);
			int rank = Integer.parseInt(split[2]);
			int mem = Integer.parseInt(split[3]);
			con[(building-1)][(floor-1)][(rank-1)] += mem;

		}
		for (int i = 0; i<4 ; i++ ) {
			for (int j = 0; j < 3  ;j++ ) {
				for (int k = 0; k < 10 ; k++ ) {
					if ( k == 9) {
						System.out.print(" " + con[i][j][k] +"\n");
					}else{

					System.out.print(" " +con[i][j][k]);
					}
				}
			}
			if (i < 3) {
			System.out.println("####################");
			}
		}
	} main { 
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String sc = br.readLine();
		int n = Integer.parseInt(sc);
		int[][][] con = new int[4][3][10];
		for (int i = 0; i<n ; i++ ) {
			String line = br.readLine();
			String[] split = line.split(" ");
			int building = Integer.parseInt(split[0]);
			int floor = Integer.parseInt(split[1]);
			int rank = Integer.parseInt(split[2]);
			int mem = Integer.parseInt(split[3]);
			con[(building-1)][(floor-1)][(rank-1)] += mem;

		}
		for (int i = 0; i<4 ; i++ ) {
			for (int j = 0; j < 3  ;j++ ) {
				for (int k = 0; k < 10 ; k++ ) {
					if ( k == 9) {
						System.out.print(" " + con[i][j][k] +"\n");
					}else{

					System.out.print(" " +con[i][j][k]);
					}
				}
			}
			if (i < 3) {
			System.out.println("####################");
			}
		}
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String sc = br.readLine(); sc br.readLine() br.readLine br int n = Integer.parseInt(sc); n Integer.parseInt(sc) Integer.parseInt Integer sc int[][][] con = new int[4][3][10]; con new int[4][3][10] 4 3 10 for (int i = 0; i<n ; i++ ) {
			String line = br.readLine();
			String[] split = line.split(" ");
			int building = Integer.parseInt(split[0]);
			int floor = Integer.parseInt(split[1]);
			int rank = Integer.parseInt(split[2]);
			int mem = Integer.parseInt(split[3]);
			con[(building-1)][(floor-1)][(rank-1)] += mem;

		} int i = 0; int i = 0; i 0 i<n i n i++ i++ i {
			String line = br.readLine();
			String[] split = line.split(" ");
			int building = Integer.parseInt(split[0]);
			int floor = Integer.parseInt(split[1]);
			int rank = Integer.parseInt(split[2]);
			int mem = Integer.parseInt(split[3]);
			con[(building-1)][(floor-1)][(rank-1)] += mem;

		} {
			String line = br.readLine();
			String[] split = line.split(" ");
			int building = Integer.parseInt(split[0]);
			int floor = Integer.parseInt(split[1]);
			int rank = Integer.parseInt(split[2]);
			int mem = Integer.parseInt(split[3]);
			con[(building-1)][(floor-1)][(rank-1)] += mem;

		} String line = br.readLine(); line br.readLine() br.readLine br String[] split = line.split(" "); split line.split(" ") line.split line " " int building = Integer.parseInt(split[0]); building Integer.parseInt(split[0]) Integer.parseInt Integer split[0] split 0 int floor = Integer.parseInt(split[1]); floor Integer.parseInt(split[1]) Integer.parseInt Integer split[1] split 1 int rank = Integer.parseInt(split[2]); rank Integer.parseInt(split[2]) Integer.parseInt Integer split[2] split 2 int mem = Integer.parseInt(split[3]); mem Integer.parseInt(split[3]) Integer.parseInt Integer split[3] split 3 con[(building-1)][(floor-1)][(rank-1)] += mem con[(building-1)][(floor-1)][(rank-1)] con[(building-1)][(floor-1)] con[(building-1)] con (building-1) building 1 (floor-1) floor 1 (rank-1) rank 1 mem for (int i = 0; i<4 ; i++ ) {
			for (int j = 0; j < 3  ;j++ ) {
				for (int k = 0; k < 10 ; k++ ) {
					if ( k == 9) {
						System.out.print(" " + con[i][j][k] +"\n");
					}else{

					System.out.print(" " +con[i][j][k]);
					}
				}
			}
			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++ ) {
					if ( k == 9) {
						System.out.print(" " + con[i][j][k] +"\n");
					}else{

					System.out.print(" " +con[i][j][k]);
					}
				}
			}
			if (i < 3) {
			System.out.println("####################");
			}
		} {
			for (int j = 0; j < 3  ;j++ ) {
				for (int k = 0; k < 10 ; k++ ) {
					if ( k == 9) {
						System.out.print(" " + con[i][j][k] +"\n");
					}else{

					System.out.print(" " +con[i][j][k]);
					}
				}
			}
			if (i < 3) {
			System.out.println("####################");
			}
		} for (int j = 0; j < 3  ;j++ ) {
				for (int k = 0; k < 10 ; k++ ) {
					if ( k == 9) {
						System.out.print(" " + con[i][j][k] +"\n");
					}else{

					System.out.print(" " +con[i][j][k]);
					}
				}
			} int j = 0; int j = 0; j 0 j < 3 j 3 j++ j++ j {
				for (int k = 0; k < 10 ; k++ ) {
					if ( k == 9) {
						System.out.print(" " + con[i][j][k] +"\n");
					}else{

					System.out.print(" " +con[i][j][k]);
					}
				}
			} {
				for (int k = 0; k < 10 ; k++ ) {
					if ( k == 9) {
						System.out.print(" " + con[i][j][k] +"\n");
					}else{

					System.out.print(" " +con[i][j][k]);
					}
				}
			} for (int k = 0; k < 10 ; k++ ) {
					if ( k == 9) {
						System.out.print(" " + con[i][j][k] +"\n");
					}else{

					System.out.print(" " +con[i][j][k]);
					}
				} int k = 0; int k = 0; k 0 k < 10 k 10 k++ k++ k {
					if ( k == 9) {
						System.out.print(" " + con[i][j][k] +"\n");
					}else{

					System.out.print(" " +con[i][j][k]);
					}
				} {
					if ( k == 9) {
						System.out.print(" " + con[i][j][k] +"\n");
					}else{

					System.out.print(" " +con[i][j][k]);
					}
				} if ( k == 9) {
						System.out.print(" " + con[i][j][k] +"\n");
					}else{

					System.out.print(" " +con[i][j][k]);
					} k == 9 k 9 {
						System.out.print(" " + con[i][j][k] +"\n");
					} System.out.print(" " + con[i][j][k] +"\n") System.out.print System.out System System.out " " + con[i][j][k] +"\n" " " + con[i][j][k] +"\n" " " con[i][j][k] con[i][j] con[i] con i j k "\n" {

					System.out.print(" " +con[i][j][k]);
					} System.out.print(" " +con[i][j][k]) System.out.print System.out System System.out " " +con[i][j][k] " " con[i][j][k] con[i][j] con[i] con i j k if (i < 3) {
			System.out.println("####################");
			} i < 3 i 3 {
			System.out.println("####################");
			} System.out.println("####################") System.out.println System.out System System.out "####################" String[] args args public class Main{
	public static void main(String[] args) throws IOException{ 
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String sc = br.readLine();
		int n = Integer.parseInt(sc);
		int[][][] con = new int[4][3][10];
		for (int i = 0; i<n ; i++ ) {
			String line = br.readLine();
			String[] split = line.split(" ");
			int building = Integer.parseInt(split[0]);
			int floor = Integer.parseInt(split[1]);
			int rank = Integer.parseInt(split[2]);
			int mem = Integer.parseInt(split[3]);
			con[(building-1)][(floor-1)][(rank-1)] += mem;

		}
		for (int i = 0; i<4 ; i++ ) {
			for (int j = 0; j < 3  ;j++ ) {
				for (int k = 0; k < 10 ; k++ ) {
					if ( k == 9) {
						System.out.print(" " + con[i][j][k] +"\n");
					}else{

					System.out.print(" " +con[i][j][k]);
					}
				}
			}
			if (i < 3) {
			System.out.println("####################");
			}
		}
	}
} public class Main{
	public static void main(String[] args) throws IOException{ 
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String sc = br.readLine();
		int n = Integer.parseInt(sc);
		int[][][] con = new int[4][3][10];
		for (int i = 0; i<n ; i++ ) {
			String line = br.readLine();
			String[] split = line.split(" ");
			int building = Integer.parseInt(split[0]);
			int floor = Integer.parseInt(split[1]);
			int rank = Integer.parseInt(split[2]);
			int mem = Integer.parseInt(split[3]);
			con[(building-1)][(floor-1)][(rank-1)] += mem;

		}
		for (int i = 0; i<4 ; i++ ) {
			for (int j = 0; j < 3  ;j++ ) {
				for (int k = 0; k < 10 ; k++ ) {
					if ( k == 9) {
						System.out.print(" " + con[i][j][k] +"\n");
					}else{

					System.out.print(" " +con[i][j][k]);
					}
				}
			}
			if (i < 3) {
			System.out.println("####################");
			}
		}
	}
} Main
import java.io.*;
import java.util.Arrays;

public class Main{
	public static void main(String[] args) throws IOException{ 
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String sc = br.readLine();
		int n = Integer.parseInt(sc);
		int[][][] con = new int[4][3][10];
		for (int i = 0; i<n ; i++ ) {
			String line = br.readLine();
			String[] split = line.split(" ");
			int building = Integer.parseInt(split[0]);
			int floor = Integer.parseInt(split[1]);
			int rank = Integer.parseInt(split[2]);
			int mem = Integer.parseInt(split[3]);
			con[(building-1)][(floor-1)][(rank-1)] += mem;

		}
		for (int i = 0; i<4 ; i++ ) {
			for (int j = 0; j < 3  ;j++ ) {
				for (int k = 0; k < 10 ; k++ ) {
					if ( k == 9) {
						System.out.print(" " + con[i][j][k] +"\n");
					}else{

					System.out.print(" " +con[i][j][k]);
					}
				}
			}
			if (i < 3) {
			System.out.println("####################");
			}
		}
	}
}