import java.util.Scanner;
public class Main{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[][][] kan = new int[4][3][10];
        int num=sc.nextInt();
        for(int i=0;i<num;i++){
            int b=sc.nextInt(),f=sc.nextInt(),r=sc.nextInt(),v=sc.nextInt();
            kan[b-1][f-1][r-1] += v;
        }
        
        for(int i=0;i<4;i++){
            for(int k=0;k<3;k++){
                for(int l=0;l<10;l++){
                    System.out.print(" "+kan[i][k][l]);
                }
                System.out.print("\n");
            }
            if(i!=3){
                System.out.println("####################");
            }
        }
        sc.close();
    }
}
 import java.util.Scanner; Scanner java.util public class Main{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[][][] kan = new int[4][3][10];
        int num=sc.nextInt();
        for(int i=0;i<num;i++){
            int b=sc.nextInt(),f=sc.nextInt(),r=sc.nextInt(),v=sc.nextInt();
            kan[b-1][f-1][r-1] += v;
        }
        
        for(int i=0;i<4;i++){
            for(int k=0;k<3;k++){
                for(int l=0;l<10;l++){
                    System.out.print(" "+kan[i][k][l]);
                }
                System.out.print("\n");
            }
            if(i!=3){
                System.out.println("####################");
            }
        }
        sc.close();
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[][][] kan = new int[4][3][10];
        int num=sc.nextInt();
        for(int i=0;i<num;i++){
            int b=sc.nextInt(),f=sc.nextInt(),r=sc.nextInt(),v=sc.nextInt();
            kan[b-1][f-1][r-1] += v;
        }
        
        for(int i=0;i<4;i++){
            for(int k=0;k<3;k++){
                for(int l=0;l<10;l++){
                    System.out.print(" "+kan[i][k][l]);
                }
                System.out.print("\n");
            }
            if(i!=3){
                System.out.println("####################");
            }
        }
        sc.close();
    } main {
        Scanner sc = new Scanner(System.in);
        int[][][] kan = new int[4][3][10];
        int num=sc.nextInt();
        for(int i=0;i<num;i++){
            int b=sc.nextInt(),f=sc.nextInt(),r=sc.nextInt(),v=sc.nextInt();
            kan[b-1][f-1][r-1] += v;
        }
        
        for(int i=0;i<4;i++){
            for(int k=0;k<3;k++){
                for(int l=0;l<10;l++){
                    System.out.print(" "+kan[i][k][l]);
                }
                System.out.print("\n");
            }
            if(i!=3){
                System.out.println("####################");
            }
        }
        sc.close();
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int[][][] kan = new int[4][3][10]; kan new int[4][3][10] 4 3 10 int num=sc.nextInt(); num sc.nextInt() sc.nextInt sc for(int i=0;i<num;i++){
            int b=sc.nextInt(),f=sc.nextInt(),r=sc.nextInt(),v=sc.nextInt();
            kan[b-1][f-1][r-1] += v;
        } int i=0; int i=0; i 0 i<num i num i++ i++ i {
            int b=sc.nextInt(),f=sc.nextInt(),r=sc.nextInt(),v=sc.nextInt();
            kan[b-1][f-1][r-1] += v;
        } {
            int b=sc.nextInt(),f=sc.nextInt(),r=sc.nextInt(),v=sc.nextInt();
            kan[b-1][f-1][r-1] += v;
        } int b=sc.nextInt() b sc.nextInt() sc.nextInt sc f=sc.nextInt() f sc.nextInt() sc.nextInt sc r=sc.nextInt() r sc.nextInt() sc.nextInt sc v=sc.nextInt(); v sc.nextInt() sc.nextInt sc kan[b-1][f-1][r-1] += v kan[b-1][f-1][r-1] kan[b-1][f-1] kan[b-1] kan b-1 b 1 f-1 f 1 r-1 r 1 v for(int i=0;i<4;i++){
            for(int k=0;k<3;k++){
                for(int l=0;l<10;l++){
                    System.out.print(" "+kan[i][k][l]);
                }
                System.out.print("\n");
            }
            if(i!=3){
                System.out.println("####################");
            }
        } int i=0; int i=0; i 0 i<4 i 4 i++ i++ i {
            for(int k=0;k<3;k++){
                for(int l=0;l<10;l++){
                    System.out.print(" "+kan[i][k][l]);
                }
                System.out.print("\n");
            }
            if(i!=3){
                System.out.println("####################");
            }
        } {
            for(int k=0;k<3;k++){
                for(int l=0;l<10;l++){
                    System.out.print(" "+kan[i][k][l]);
                }
                System.out.print("\n");
            }
            if(i!=3){
                System.out.println("####################");
            }
        } for(int k=0;k<3;k++){
                for(int l=0;l<10;l++){
                    System.out.print(" "+kan[i][k][l]);
                }
                System.out.print("\n");
            } int k=0; int k=0; k 0 k<3 k 3 k++ k++ k {
                for(int l=0;l<10;l++){
                    System.out.print(" "+kan[i][k][l]);
                }
                System.out.print("\n");
            } {
                for(int l=0;l<10;l++){
                    System.out.print(" "+kan[i][k][l]);
                }
                System.out.print("\n");
            } for(int l=0;l<10;l++){
                    System.out.print(" "+kan[i][k][l]);
                } int l=0; int l=0; l 0 l<10 l 10 l++ l++ l {
                    System.out.print(" "+kan[i][k][l]);
                } {
                    System.out.print(" "+kan[i][k][l]);
                } System.out.print(" "+kan[i][k][l]) System.out.print System.out System System.out " "+kan[i][k][l] " " kan[i][k][l] kan[i][k] kan[i] kan i k l System.out.print("\n") System.out.print System.out System System.out "\n" if(i!=3){
                System.out.println("####################");
            } i!=3 i 3 {
                System.out.println("####################");
            } System.out.println("####################") System.out.println System.out System System.out "####################" sc.close() sc.close sc String[] args args public class Main{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[][][] kan = new int[4][3][10];
        int num=sc.nextInt();
        for(int i=0;i<num;i++){
            int b=sc.nextInt(),f=sc.nextInt(),r=sc.nextInt(),v=sc.nextInt();
            kan[b-1][f-1][r-1] += v;
        }
        
        for(int i=0;i<4;i++){
            for(int k=0;k<3;k++){
                for(int l=0;l<10;l++){
                    System.out.print(" "+kan[i][k][l]);
                }
                System.out.print("\n");
            }
            if(i!=3){
                System.out.println("####################");
            }
        }
        sc.close();
    }
} public class Main{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[][][] kan = new int[4][3][10];
        int num=sc.nextInt();
        for(int i=0;i<num;i++){
            int b=sc.nextInt(),f=sc.nextInt(),r=sc.nextInt(),v=sc.nextInt();
            kan[b-1][f-1][r-1] += v;
        }
        
        for(int i=0;i<4;i++){
            for(int k=0;k<3;k++){
                for(int l=0;l<10;l++){
                    System.out.print(" "+kan[i][k][l]);
                }
                System.out.print("\n");
            }
            if(i!=3){
                System.out.println("####################");
            }
        }
        sc.close();
    }
} Main
import java.util.Scanner;
public class Main{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[][][] kan = new int[4][3][10];
        int num=sc.nextInt();
        for(int i=0;i<num;i++){
            int b=sc.nextInt(),f=sc.nextInt(),r=sc.nextInt(),v=sc.nextInt();
            kan[b-1][f-1][r-1] += v;
        }
        
        for(int i=0;i<4;i++){
            for(int k=0;k<3;k++){
                for(int l=0;l<10;l++){
                    System.out.print(" "+kan[i][k][l]);
                }
                System.out.print("\n");
            }
            if(i!=3){
                System.out.println("####################");
            }
        }
        sc.close();
    }
}

