import java.io.*;

public class Main{
	public static void main(String[] args) throws Exception{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		int[][][] dormitory = new int[4][3][10]; //??????????????????
		int b,f,r,v;
		
		//?±?????????°?????¨????????????????¨????
		for(int i=0; i<n; i++){
			String[] str = br.readLine().split(" ");
			b = Integer.parseInt(str[0])-1;
			f = Integer.parseInt(str[1])-1;
			r = Integer.parseInt(str[2])-1;
			v = Integer.parseInt(str[3]);
			
			dormitory[b][f][r] += v; //v????????????????????????????????§???????????????
		}
		
		//?????????????±?????????°?????¨???
		for(int i=0; i<4; i++){
			for(int j=0; j<3; j++){
				for(int k=0; k<10; k++){
					System.out.print(" "+dormitory[i][j][k]);
				}
				System.out.println();
			}
			if(i!=3){
				System.out.println("####################");
			}
		}
	}
} import java.io.*; io.* java public class Main{
	public static void main(String[] args) throws Exception{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		int[][][] dormitory = new int[4][3][10]; //??????????????????
		int b,f,r,v;
		
		//?±?????????°?????¨????????????????¨????
		for(int i=0; i<n; i++){
			String[] str = br.readLine().split(" ");
			b = Integer.parseInt(str[0])-1;
			f = Integer.parseInt(str[1])-1;
			r = Integer.parseInt(str[2])-1;
			v = Integer.parseInt(str[3]);
			
			dormitory[b][f][r] += v; //v????????????????????????????????§???????????????
		}
		
		//?????????????±?????????°?????¨???
		for(int i=0; i<4; i++){
			for(int j=0; j<3; j++){
				for(int k=0; k<10; k++){
					System.out.print(" "+dormitory[i][j][k]);
				}
				System.out.println();
			}
			if(i!=3){
				System.out.println("####################");
			}
		}
	}
} Main public static void main(String[] args) throws Exception{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		int[][][] dormitory = new int[4][3][10]; //??????????????????
		int b,f,r,v;
		
		//?±?????????°?????¨????????????????¨????
		for(int i=0; i<n; i++){
			String[] str = br.readLine().split(" ");
			b = Integer.parseInt(str[0])-1;
			f = Integer.parseInt(str[1])-1;
			r = Integer.parseInt(str[2])-1;
			v = Integer.parseInt(str[3]);
			
			dormitory[b][f][r] += v; //v????????????????????????????????§???????????????
		}
		
		//?????????????±?????????°?????¨???
		for(int i=0; i<4; i++){
			for(int j=0; j<3; j++){
				for(int k=0; k<10; k++){
					System.out.print(" "+dormitory[i][j][k]);
				}
				System.out.println();
			}
			if(i!=3){
				System.out.println("####################");
			}
		}
	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		int[][][] dormitory = new int[4][3][10]; //??????????????????
		int b,f,r,v;
		
		//?±?????????°?????¨????????????????¨????
		for(int i=0; i<n; i++){
			String[] str = br.readLine().split(" ");
			b = Integer.parseInt(str[0])-1;
			f = Integer.parseInt(str[1])-1;
			r = Integer.parseInt(str[2])-1;
			v = Integer.parseInt(str[3]);
			
			dormitory[b][f][r] += v; //v????????????????????????????????§???????????????
		}
		
		//?????????????±?????????°?????¨???
		for(int i=0; i<4; i++){
			for(int j=0; j<3; j++){
				for(int k=0; k<10; k++){
					System.out.print(" "+dormitory[i][j][k]);
				}
				System.out.println();
			}
			if(i!=3){
				System.out.println("####################");
			}
		}
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) int n = Integer.parseInt(br.readLine()); n Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br int[][][] dormitory = new int[4][3][10]; dormitory new int[4][3][10] 4 3 10 int b b f f r r v; v for(int i=0; i<n; i++){
			String[] str = br.readLine().split(" ");
			b = Integer.parseInt(str[0])-1;
			f = Integer.parseInt(str[1])-1;
			r = Integer.parseInt(str[2])-1;
			v = Integer.parseInt(str[3]);
			
			dormitory[b][f][r] += v; //v????????????????????????????????§???????????????
		} int i=0; int i=0; i 0 i<n i n i++ i++ i {
			String[] str = br.readLine().split(" ");
			b = Integer.parseInt(str[0])-1;
			f = Integer.parseInt(str[1])-1;
			r = Integer.parseInt(str[2])-1;
			v = Integer.parseInt(str[3]);
			
			dormitory[b][f][r] += v; //v????????????????????????????????§???????????????
		} {
			String[] str = br.readLine().split(" ");
			b = Integer.parseInt(str[0])-1;
			f = Integer.parseInt(str[1])-1;
			r = Integer.parseInt(str[2])-1;
			v = Integer.parseInt(str[3]);
			
			dormitory[b][f][r] += v; //v????????????????????????????????§???????????????
		} String[] str = br.readLine().split(" "); str br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " b = Integer.parseInt(str[0])-1 b Integer.parseInt(str[0])-1 Integer.parseInt(str[0]) Integer.parseInt Integer str[0] str 0 1 f = Integer.parseInt(str[1])-1 f Integer.parseInt(str[1])-1 Integer.parseInt(str[1]) Integer.parseInt Integer str[1] str 1 1 r = Integer.parseInt(str[2])-1 r Integer.parseInt(str[2])-1 Integer.parseInt(str[2]) Integer.parseInt Integer str[2] str 2 1 v = Integer.parseInt(str[3]) v Integer.parseInt(str[3]) Integer.parseInt Integer str[3] str 3 dormitory[b][f][r] += v dormitory[b][f][r] dormitory[b][f] dormitory[b] dormitory 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.print(" "+dormitory[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.print(" "+dormitory[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.print(" "+dormitory[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.print(" "+dormitory[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.print(" "+dormitory[i][j][k]);
				}
				System.out.println();
			} {
				for(int k=0; k<10; k++){
					System.out.print(" "+dormitory[i][j][k]);
				}
				System.out.println();
			} for(int k=0; k<10; k++){
					System.out.print(" "+dormitory[i][j][k]);
				} int k=0; int k=0; k 0 k<10 k 10 k++ k++ k {
					System.out.print(" "+dormitory[i][j][k]);
				} {
					System.out.print(" "+dormitory[i][j][k]);
				} System.out.print(" "+dormitory[i][j][k]) System.out.print System.out System System.out " "+dormitory[i][j][k] " " dormitory[i][j][k] dormitory[i][j] dormitory[i] dormitory 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 "####################" String[] args args public class Main{
	public static void main(String[] args) throws Exception{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		int[][][] dormitory = new int[4][3][10]; //??????????????????
		int b,f,r,v;
		
		//?±?????????°?????¨????????????????¨????
		for(int i=0; i<n; i++){
			String[] str = br.readLine().split(" ");
			b = Integer.parseInt(str[0])-1;
			f = Integer.parseInt(str[1])-1;
			r = Integer.parseInt(str[2])-1;
			v = Integer.parseInt(str[3]);
			
			dormitory[b][f][r] += v; //v????????????????????????????????§???????????????
		}
		
		//?????????????±?????????°?????¨???
		for(int i=0; i<4; i++){
			for(int j=0; j<3; j++){
				for(int k=0; k<10; k++){
					System.out.print(" "+dormitory[i][j][k]);
				}
				System.out.println();
			}
			if(i!=3){
				System.out.println("####################");
			}
		}
	}
} public class Main{
	public static void main(String[] args) throws Exception{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		int[][][] dormitory = new int[4][3][10]; //??????????????????
		int b,f,r,v;
		
		//?±?????????°?????¨????????????????¨????
		for(int i=0; i<n; i++){
			String[] str = br.readLine().split(" ");
			b = Integer.parseInt(str[0])-1;
			f = Integer.parseInt(str[1])-1;
			r = Integer.parseInt(str[2])-1;
			v = Integer.parseInt(str[3]);
			
			dormitory[b][f][r] += v; //v????????????????????????????????§???????????????
		}
		
		//?????????????±?????????°?????¨???
		for(int i=0; i<4; i++){
			for(int j=0; j<3; j++){
				for(int k=0; k<10; k++){
					System.out.print(" "+dormitory[i][j][k]);
				}
				System.out.println();
			}
			if(i!=3){
				System.out.println("####################");
			}
		}
	}
} Main
import java.io.*;

public class Main{
	public static void main(String[] args) throws Exception{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		int[][][] dormitory = new int[4][3][10]; //??????????????????
		int b,f,r,v;
		
		//?±?????????°?????¨????????????????¨????
		for(int i=0; i<n; i++){
			String[] str = br.readLine().split(" ");
			b = Integer.parseInt(str[0])-1;
			f = Integer.parseInt(str[1])-1;
			r = Integer.parseInt(str[2])-1;
			v = Integer.parseInt(str[3]);
			
			dormitory[b][f][r] += v; //v????????????????????????????????§???????????????
		}
		
		//?????????????±?????????°?????¨???
		for(int i=0; i<4; i++){
			for(int j=0; j<3; j++){
				for(int k=0; k<10; k++){
					System.out.print(" "+dormitory[i][j][k]);
				}
				System.out.println();
			}
			if(i!=3){
				System.out.println("####################");
			}
		}
	}
}