import java.util.Scanner;

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

public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[][][] info = new int[4][3][10]; 
        for(int i=0;i<n;i++){
            int b= sc.nextInt();
            int f = sc.nextInt();
            int r= sc.nextInt();
            int v= sc.nextInt();
            info[b-1][f-1][r-1]+=v;
        }
        for(int i=0;i<4;i++){
            for(int j=0;j<3;j++){
                for(int m=0;m<10;m++){
                    System.out.printf(" %d",info[i][j][m]);
                }
                System.out.println();
            }
            if(i!=3){
                System.out.printf("####################\n");
            }
        }
        sc.close();
    }
}
