import java.util.Scanner;

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

class Main{
    public static void main(String[] args){
    	int residents[][][] = new int[4][3][10];
        int n,b, f, r, v;
        
		Scanner scanner = new Scanner(System.in);
		n = scanner.nextInt();
		
		for(int i = 0;i < n;i++){
			b = scanner.nextInt();
			f = scanner.nextInt();
			r = scanner.nextInt();
			v = scanner.nextInt();
			
			residents[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.print(" "+residents[i][j][k]);
				}
				System.out.println();
			}
			if(i != 3){
				System.out.println("####################");
			}						
		}		
    	scanner.close();
    }
}