import java.util.Scanner;

public class Main {
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		
		int n = scan.nextInt(); // infomation amount
	
		int[][] b1 = new int[4][11];
		int[][] b2 = new int[4][11];
		int[][] b3 = new int[4][11];
		int[][] b4 = new int[4][11];
		
		for(int i = 0; i < n; i++){
			
			int b = scan.nextInt(); // tou
			int f = scan.nextInt(); // flor
			int r = scan.nextInt(); // room
			int v = scan.nextInt(); // ninzu
		
			if(b == 1){
				b1[f][r] += v;
				}else if(b == 2){
					b2[f][r] += v;
				}else if(b == 3){
					b3[f][r] += v;
				}else if(b == 4){
					b4[f][r] += v;
				}
		}
		
		for(int i = 1; i <= 3; i++){
			for(int j = 1; j <= 10; j++){
				System.out.print(" " + b1[i][j]);
			}
			System.out.println();
		}
		
		System.out.println("####################");
		
		for(int i = 1; i <= 3; i++){
			for(int j = 1; j <= 10; j++){
				System.out.print(" " + b2[i][j]);
			}
			System.out.println();
		}
		
		System.out.println("####################");
		
		for(int i = 1; i <= 3; i++){
			for(int j = 1; j <= 10; j++){
				System.out.print(" " + b3[i][j]);
			}
			System.out.println();
		}
		
		System.out.println("####################"); 
		
		for(int i = 1; i <= 3; i++){
			for(int j = 1; j <= 10; j++){
				System.out.print(" " + b4[i][j]);
			}
			System.out.println();
		}
		
		
		
		
	}

} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		
		int n = scan.nextInt(); // infomation amount
	
		int[][] b1 = new int[4][11];
		int[][] b2 = new int[4][11];
		int[][] b3 = new int[4][11];
		int[][] b4 = new int[4][11];
		
		for(int i = 0; i < n; i++){
			
			int b = scan.nextInt(); // tou
			int f = scan.nextInt(); // flor
			int r = scan.nextInt(); // room
			int v = scan.nextInt(); // ninzu
		
			if(b == 1){
				b1[f][r] += v;
				}else if(b == 2){
					b2[f][r] += v;
				}else if(b == 3){
					b3[f][r] += v;
				}else if(b == 4){
					b4[f][r] += v;
				}
		}
		
		for(int i = 1; i <= 3; i++){
			for(int j = 1; j <= 10; j++){
				System.out.print(" " + b1[i][j]);
			}
			System.out.println();
		}
		
		System.out.println("####################");
		
		for(int i = 1; i <= 3; i++){
			for(int j = 1; j <= 10; j++){
				System.out.print(" " + b2[i][j]);
			}
			System.out.println();
		}
		
		System.out.println("####################");
		
		for(int i = 1; i <= 3; i++){
			for(int j = 1; j <= 10; j++){
				System.out.print(" " + b3[i][j]);
			}
			System.out.println();
		}
		
		System.out.println("####################"); 
		
		for(int i = 1; i <= 3; i++){
			for(int j = 1; j <= 10; j++){
				System.out.print(" " + b4[i][j]);
			}
			System.out.println();
		}
		
		
		
		
	}

} Main public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		
		int n = scan.nextInt(); // infomation amount
	
		int[][] b1 = new int[4][11];
		int[][] b2 = new int[4][11];
		int[][] b3 = new int[4][11];
		int[][] b4 = new int[4][11];
		
		for(int i = 0; i < n; i++){
			
			int b = scan.nextInt(); // tou
			int f = scan.nextInt(); // flor
			int r = scan.nextInt(); // room
			int v = scan.nextInt(); // ninzu
		
			if(b == 1){
				b1[f][r] += v;
				}else if(b == 2){
					b2[f][r] += v;
				}else if(b == 3){
					b3[f][r] += v;
				}else if(b == 4){
					b4[f][r] += v;
				}
		}
		
		for(int i = 1; i <= 3; i++){
			for(int j = 1; j <= 10; j++){
				System.out.print(" " + b1[i][j]);
			}
			System.out.println();
		}
		
		System.out.println("####################");
		
		for(int i = 1; i <= 3; i++){
			for(int j = 1; j <= 10; j++){
				System.out.print(" " + b2[i][j]);
			}
			System.out.println();
		}
		
		System.out.println("####################");
		
		for(int i = 1; i <= 3; i++){
			for(int j = 1; j <= 10; j++){
				System.out.print(" " + b3[i][j]);
			}
			System.out.println();
		}
		
		System.out.println("####################"); 
		
		for(int i = 1; i <= 3; i++){
			for(int j = 1; j <= 10; j++){
				System.out.print(" " + b4[i][j]);
			}
			System.out.println();
		}
		
		
		
		
	} main {
		Scanner scan = new Scanner(System.in);
		
		int n = scan.nextInt(); // infomation amount
	
		int[][] b1 = new int[4][11];
		int[][] b2 = new int[4][11];
		int[][] b3 = new int[4][11];
		int[][] b4 = new int[4][11];
		
		for(int i = 0; i < n; i++){
			
			int b = scan.nextInt(); // tou
			int f = scan.nextInt(); // flor
			int r = scan.nextInt(); // room
			int v = scan.nextInt(); // ninzu
		
			if(b == 1){
				b1[f][r] += v;
				}else if(b == 2){
					b2[f][r] += v;
				}else if(b == 3){
					b3[f][r] += v;
				}else if(b == 4){
					b4[f][r] += v;
				}
		}
		
		for(int i = 1; i <= 3; i++){
			for(int j = 1; j <= 10; j++){
				System.out.print(" " + b1[i][j]);
			}
			System.out.println();
		}
		
		System.out.println("####################");
		
		for(int i = 1; i <= 3; i++){
			for(int j = 1; j <= 10; j++){
				System.out.print(" " + b2[i][j]);
			}
			System.out.println();
		}
		
		System.out.println("####################");
		
		for(int i = 1; i <= 3; i++){
			for(int j = 1; j <= 10; j++){
				System.out.print(" " + b3[i][j]);
			}
			System.out.println();
		}
		
		System.out.println("####################"); 
		
		for(int i = 1; i <= 3; i++){
			for(int j = 1; j <= 10; j++){
				System.out.print(" " + b4[i][j]);
			}
			System.out.println();
		}
		
		
		
		
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan int[][] b1 = new int[4][11]; b1 new int[4][11] 4 11 int[][] b2 = new int[4][11]; b2 new int[4][11] 4 11 int[][] b3 = new int[4][11]; b3 new int[4][11] 4 11 int[][] b4 = new int[4][11]; b4 new int[4][11] 4 11 for(int i = 0; i < n; i++){
			
			int b = scan.nextInt(); // tou
			int f = scan.nextInt(); // flor
			int r = scan.nextInt(); // room
			int v = scan.nextInt(); // ninzu
		
			if(b == 1){
				b1[f][r] += v;
				}else if(b == 2){
					b2[f][r] += v;
				}else if(b == 3){
					b3[f][r] += v;
				}else if(b == 4){
					b4[f][r] += v;
				}
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			
			int b = scan.nextInt(); // tou
			int f = scan.nextInt(); // flor
			int r = scan.nextInt(); // room
			int v = scan.nextInt(); // ninzu
		
			if(b == 1){
				b1[f][r] += v;
				}else if(b == 2){
					b2[f][r] += v;
				}else if(b == 3){
					b3[f][r] += v;
				}else if(b == 4){
					b4[f][r] += v;
				}
		} {
			
			int b = scan.nextInt(); // tou
			int f = scan.nextInt(); // flor
			int r = scan.nextInt(); // room
			int v = scan.nextInt(); // ninzu
		
			if(b == 1){
				b1[f][r] += v;
				}else if(b == 2){
					b2[f][r] += v;
				}else if(b == 3){
					b3[f][r] += v;
				}else if(b == 4){
					b4[f][r] += 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 if(b == 1){
				b1[f][r] += v;
				}else if(b == 2){
					b2[f][r] += v;
				}else if(b == 3){
					b3[f][r] += v;
				}else if(b == 4){
					b4[f][r] += v;
				} b == 1 b 1 {
				b1[f][r] += v;
				} b1[f][r] += v b1[f][r] b1[f] b1 f r v if(b == 2){
					b2[f][r] += v;
				}else if(b == 3){
					b3[f][r] += v;
				}else if(b == 4){
					b4[f][r] += v;
				} b == 2 b 2 {
					b2[f][r] += v;
				} b2[f][r] += v b2[f][r] b2[f] b2 f r v if(b == 3){
					b3[f][r] += v;
				}else if(b == 4){
					b4[f][r] += v;
				} b == 3 b 3 {
					b3[f][r] += v;
				} b3[f][r] += v b3[f][r] b3[f] b3 f r v if(b == 4){
					b4[f][r] += v;
				} b == 4 b 4 {
					b4[f][r] += v;
				} b4[f][r] += v b4[f][r] b4[f] b4 f r v for(int i = 1; i <= 3; i++){
			for(int j = 1; j <= 10; j++){
				System.out.print(" " + b1[i][j]);
			}
			System.out.println();
		} int i = 1; int i = 1; i 1 i <= 3 i 3 i++ i++ i {
			for(int j = 1; j <= 10; j++){
				System.out.print(" " + b1[i][j]);
			}
			System.out.println();
		} {
			for(int j = 1; j <= 10; j++){
				System.out.print(" " + b1[i][j]);
			}
			System.out.println();
		} for(int j = 1; j <= 10; j++){
				System.out.print(" " + b1[i][j]);
			} int j = 1; int j = 1; j 1 j <= 10 j 10 j++ j++ j {
				System.out.print(" " + b1[i][j]);
			} {
				System.out.print(" " + b1[i][j]);
			} System.out.print(" " + b1[i][j]) System.out.print System.out System System.out " " + b1[i][j] " " b1[i][j] b1[i] b1 i j System.out.println() System.out.println System.out System System.out System.out.println("####################") System.out.println System.out System System.out "####################" for(int i = 1; i <= 3; i++){
			for(int j = 1; j <= 10; j++){
				System.out.print(" " + b2[i][j]);
			}
			System.out.println();
		} int i = 1; int i = 1; i 1 i <= 3 i 3 i++ i++ i {
			for(int j = 1; j <= 10; j++){
				System.out.print(" " + b2[i][j]);
			}
			System.out.println();
		} {
			for(int j = 1; j <= 10; j++){
				System.out.print(" " + b2[i][j]);
			}
			System.out.println();
		} for(int j = 1; j <= 10; j++){
				System.out.print(" " + b2[i][j]);
			} int j = 1; int j = 1; j 1 j <= 10 j 10 j++ j++ j {
				System.out.print(" " + b2[i][j]);
			} {
				System.out.print(" " + b2[i][j]);
			} System.out.print(" " + b2[i][j]) System.out.print System.out System System.out " " + b2[i][j] " " b2[i][j] b2[i] b2 i j System.out.println() System.out.println System.out System System.out System.out.println("####################") System.out.println System.out System System.out "####################" for(int i = 1; i <= 3; i++){
			for(int j = 1; j <= 10; j++){
				System.out.print(" " + b3[i][j]);
			}
			System.out.println();
		} int i = 1; int i = 1; i 1 i <= 3 i 3 i++ i++ i {
			for(int j = 1; j <= 10; j++){
				System.out.print(" " + b3[i][j]);
			}
			System.out.println();
		} {
			for(int j = 1; j <= 10; j++){
				System.out.print(" " + b3[i][j]);
			}
			System.out.println();
		} for(int j = 1; j <= 10; j++){
				System.out.print(" " + b3[i][j]);
			} int j = 1; int j = 1; j 1 j <= 10 j 10 j++ j++ j {
				System.out.print(" " + b3[i][j]);
			} {
				System.out.print(" " + b3[i][j]);
			} System.out.print(" " + b3[i][j]) System.out.print System.out System System.out " " + b3[i][j] " " b3[i][j] b3[i] b3 i j System.out.println() System.out.println System.out System System.out System.out.println("####################") System.out.println System.out System System.out "####################" for(int i = 1; i <= 3; i++){
			for(int j = 1; j <= 10; j++){
				System.out.print(" " + b4[i][j]);
			}
			System.out.println();
		} int i = 1; int i = 1; i 1 i <= 3 i 3 i++ i++ i {
			for(int j = 1; j <= 10; j++){
				System.out.print(" " + b4[i][j]);
			}
			System.out.println();
		} {
			for(int j = 1; j <= 10; j++){
				System.out.print(" " + b4[i][j]);
			}
			System.out.println();
		} for(int j = 1; j <= 10; j++){
				System.out.print(" " + b4[i][j]);
			} int j = 1; int j = 1; j 1 j <= 10 j 10 j++ j++ j {
				System.out.print(" " + b4[i][j]);
			} {
				System.out.print(" " + b4[i][j]);
			} System.out.print(" " + b4[i][j]) System.out.print System.out System System.out " " + b4[i][j] " " b4[i][j] b4[i] b4 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){
		Scanner scan = new Scanner(System.in);
		
		int n = scan.nextInt(); // infomation amount
	
		int[][] b1 = new int[4][11];
		int[][] b2 = new int[4][11];
		int[][] b3 = new int[4][11];
		int[][] b4 = new int[4][11];
		
		for(int i = 0; i < n; i++){
			
			int b = scan.nextInt(); // tou
			int f = scan.nextInt(); // flor
			int r = scan.nextInt(); // room
			int v = scan.nextInt(); // ninzu
		
			if(b == 1){
				b1[f][r] += v;
				}else if(b == 2){
					b2[f][r] += v;
				}else if(b == 3){
					b3[f][r] += v;
				}else if(b == 4){
					b4[f][r] += v;
				}
		}
		
		for(int i = 1; i <= 3; i++){
			for(int j = 1; j <= 10; j++){
				System.out.print(" " + b1[i][j]);
			}
			System.out.println();
		}
		
		System.out.println("####################");
		
		for(int i = 1; i <= 3; i++){
			for(int j = 1; j <= 10; j++){
				System.out.print(" " + b2[i][j]);
			}
			System.out.println();
		}
		
		System.out.println("####################");
		
		for(int i = 1; i <= 3; i++){
			for(int j = 1; j <= 10; j++){
				System.out.print(" " + b3[i][j]);
			}
			System.out.println();
		}
		
		System.out.println("####################"); 
		
		for(int i = 1; i <= 3; i++){
			for(int j = 1; j <= 10; j++){
				System.out.print(" " + b4[i][j]);
			}
			System.out.println();
		}
		
		
		
		
	}

} public class Main {
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		
		int n = scan.nextInt(); // infomation amount
	
		int[][] b1 = new int[4][11];
		int[][] b2 = new int[4][11];
		int[][] b3 = new int[4][11];
		int[][] b4 = new int[4][11];
		
		for(int i = 0; i < n; i++){
			
			int b = scan.nextInt(); // tou
			int f = scan.nextInt(); // flor
			int r = scan.nextInt(); // room
			int v = scan.nextInt(); // ninzu
		
			if(b == 1){
				b1[f][r] += v;
				}else if(b == 2){
					b2[f][r] += v;
				}else if(b == 3){
					b3[f][r] += v;
				}else if(b == 4){
					b4[f][r] += v;
				}
		}
		
		for(int i = 1; i <= 3; i++){
			for(int j = 1; j <= 10; j++){
				System.out.print(" " + b1[i][j]);
			}
			System.out.println();
		}
		
		System.out.println("####################");
		
		for(int i = 1; i <= 3; i++){
			for(int j = 1; j <= 10; j++){
				System.out.print(" " + b2[i][j]);
			}
			System.out.println();
		}
		
		System.out.println("####################");
		
		for(int i = 1; i <= 3; i++){
			for(int j = 1; j <= 10; j++){
				System.out.print(" " + b3[i][j]);
			}
			System.out.println();
		}
		
		System.out.println("####################"); 
		
		for(int i = 1; i <= 3; i++){
			for(int j = 1; j <= 10; j++){
				System.out.print(" " + b4[i][j]);
			}
			System.out.println();
		}
		
		
		
		
	}

} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		
		int n = scan.nextInt(); // infomation amount
	
		int[][] b1 = new int[4][11];
		int[][] b2 = new int[4][11];
		int[][] b3 = new int[4][11];
		int[][] b4 = new int[4][11];
		
		for(int i = 0; i < n; i++){
			
			int b = scan.nextInt(); // tou
			int f = scan.nextInt(); // flor
			int r = scan.nextInt(); // room
			int v = scan.nextInt(); // ninzu
		
			if(b == 1){
				b1[f][r] += v;
				}else if(b == 2){
					b2[f][r] += v;
				}else if(b == 3){
					b3[f][r] += v;
				}else if(b == 4){
					b4[f][r] += v;
				}
		}
		
		for(int i = 1; i <= 3; i++){
			for(int j = 1; j <= 10; j++){
				System.out.print(" " + b1[i][j]);
			}
			System.out.println();
		}
		
		System.out.println("####################");
		
		for(int i = 1; i <= 3; i++){
			for(int j = 1; j <= 10; j++){
				System.out.print(" " + b2[i][j]);
			}
			System.out.println();
		}
		
		System.out.println("####################");
		
		for(int i = 1; i <= 3; i++){
			for(int j = 1; j <= 10; j++){
				System.out.print(" " + b3[i][j]);
			}
			System.out.println();
		}
		
		System.out.println("####################"); 
		
		for(int i = 1; i <= 3; i++){
			for(int j = 1; j <= 10; j++){
				System.out.print(" " + b4[i][j]);
			}
			System.out.println();
		}
		
		
		
		
	}

}