import java.util.Scanner;

public class Main{ 
        public static void main(String[] args){
            int i=0,j,k,l,m,o=0,p=0;
            int a[][];
            int q[][][];
            a = new int[1000][1000];
            q = new int[1000][10][10];
                Scanner n = new Scanner(System.in);
                int c = n.nextInt();
                while(i<c){
                     a[i][0] = n.nextInt();
                     for(j=1;j<4;j++){
                         a[i][j]=n.nextInt();
                     }
                     i++;
                }
                i=0;
                while(i<4){
                    for(m=0;m<c;m++){
                        if(((a[m][0])-1)==i){
                            q[i][(a[m][1]-1)][(a[m][2]-1)]+=a[m][3];
                        }
                    }
                        for(k=0;k<3;k++){
                            for(l=0;l<10;l++){
                                 System.out.print(" " + q[i][k][l]);
                            }
                            System.out.printf("\n");
                        }
                        if(i==3){
                            System.exit(0);
                        }else{
                        System.out.println("####################");
                        }
                     i++;
                }
        }
    } import java.util.Scanner; Scanner java.util public class Main{ 
        public static void main(String[] args){
            int i=0,j,k,l,m,o=0,p=0;
            int a[][];
            int q[][][];
            a = new int[1000][1000];
            q = new int[1000][10][10];
                Scanner n = new Scanner(System.in);
                int c = n.nextInt();
                while(i<c){
                     a[i][0] = n.nextInt();
                     for(j=1;j<4;j++){
                         a[i][j]=n.nextInt();
                     }
                     i++;
                }
                i=0;
                while(i<4){
                    for(m=0;m<c;m++){
                        if(((a[m][0])-1)==i){
                            q[i][(a[m][1]-1)][(a[m][2]-1)]+=a[m][3];
                        }
                    }
                        for(k=0;k<3;k++){
                            for(l=0;l<10;l++){
                                 System.out.print(" " + q[i][k][l]);
                            }
                            System.out.printf("\n");
                        }
                        if(i==3){
                            System.exit(0);
                        }else{
                        System.out.println("####################");
                        }
                     i++;
                }
        }
    } Main public static void main(String[] args){
            int i=0,j,k,l,m,o=0,p=0;
            int a[][];
            int q[][][];
            a = new int[1000][1000];
            q = new int[1000][10][10];
                Scanner n = new Scanner(System.in);
                int c = n.nextInt();
                while(i<c){
                     a[i][0] = n.nextInt();
                     for(j=1;j<4;j++){
                         a[i][j]=n.nextInt();
                     }
                     i++;
                }
                i=0;
                while(i<4){
                    for(m=0;m<c;m++){
                        if(((a[m][0])-1)==i){
                            q[i][(a[m][1]-1)][(a[m][2]-1)]+=a[m][3];
                        }
                    }
                        for(k=0;k<3;k++){
                            for(l=0;l<10;l++){
                                 System.out.print(" " + q[i][k][l]);
                            }
                            System.out.printf("\n");
                        }
                        if(i==3){
                            System.exit(0);
                        }else{
                        System.out.println("####################");
                        }
                     i++;
                }
        } main {
            int i=0,j,k,l,m,o=0,p=0;
            int a[][];
            int q[][][];
            a = new int[1000][1000];
            q = new int[1000][10][10];
                Scanner n = new Scanner(System.in);
                int c = n.nextInt();
                while(i<c){
                     a[i][0] = n.nextInt();
                     for(j=1;j<4;j++){
                         a[i][j]=n.nextInt();
                     }
                     i++;
                }
                i=0;
                while(i<4){
                    for(m=0;m<c;m++){
                        if(((a[m][0])-1)==i){
                            q[i][(a[m][1]-1)][(a[m][2]-1)]+=a[m][3];
                        }
                    }
                        for(k=0;k<3;k++){
                            for(l=0;l<10;l++){
                                 System.out.print(" " + q[i][k][l]);
                            }
                            System.out.printf("\n");
                        }
                        if(i==3){
                            System.exit(0);
                        }else{
                        System.out.println("####################");
                        }
                     i++;
                }
        } int i=0 i 0 j j k k l l m m o=0 o 0 p=0; p 0 int a[][]; a int q[][][]; q a = new int[1000][1000] a new int[1000][1000] 1000 1000 q = new int[1000][10][10] q new int[1000][10][10] 1000 10 10 Scanner n = new Scanner(System.in); n new Scanner(System.in) int c = n.nextInt(); c n.nextInt() n.nextInt n while(i<c){
                     a[i][0] = n.nextInt();
                     for(j=1;j<4;j++){
                         a[i][j]=n.nextInt();
                     }
                     i++;
                } i<c i c {
                     a[i][0] = n.nextInt();
                     for(j=1;j<4;j++){
                         a[i][j]=n.nextInt();
                     }
                     i++;
                } a[i][0] = n.nextInt() a[i][0] a[i] a i 0 n.nextInt() n.nextInt n for(j=1;j<4;j++){
                         a[i][j]=n.nextInt();
                     } j=1; j=1 j 1 j<4 j 4 j++ j++ j {
                         a[i][j]=n.nextInt();
                     } {
                         a[i][j]=n.nextInt();
                     } a[i][j]=n.nextInt() a[i][j] a[i] a i j n.nextInt() n.nextInt n i++ i i=0 i 0 while(i<4){
                    for(m=0;m<c;m++){
                        if(((a[m][0])-1)==i){
                            q[i][(a[m][1]-1)][(a[m][2]-1)]+=a[m][3];
                        }
                    }
                        for(k=0;k<3;k++){
                            for(l=0;l<10;l++){
                                 System.out.print(" " + q[i][k][l]);
                            }
                            System.out.printf("\n");
                        }
                        if(i==3){
                            System.exit(0);
                        }else{
                        System.out.println("####################");
                        }
                     i++;
                } i<4 i 4 {
                    for(m=0;m<c;m++){
                        if(((a[m][0])-1)==i){
                            q[i][(a[m][1]-1)][(a[m][2]-1)]+=a[m][3];
                        }
                    }
                        for(k=0;k<3;k++){
                            for(l=0;l<10;l++){
                                 System.out.print(" " + q[i][k][l]);
                            }
                            System.out.printf("\n");
                        }
                        if(i==3){
                            System.exit(0);
                        }else{
                        System.out.println("####################");
                        }
                     i++;
                } for(m=0;m<c;m++){
                        if(((a[m][0])-1)==i){
                            q[i][(a[m][1]-1)][(a[m][2]-1)]+=a[m][3];
                        }
                    } m=0; m=0 m 0 m<c m c m++ m++ m {
                        if(((a[m][0])-1)==i){
                            q[i][(a[m][1]-1)][(a[m][2]-1)]+=a[m][3];
                        }
                    } {
                        if(((a[m][0])-1)==i){
                            q[i][(a[m][1]-1)][(a[m][2]-1)]+=a[m][3];
                        }
                    } if(((a[m][0])-1)==i){
                            q[i][(a[m][1]-1)][(a[m][2]-1)]+=a[m][3];
                        } ((a[m][0])-1)==i ((a[m][0])-1) (a[m][0]) a[m] a m 0 1 i {
                            q[i][(a[m][1]-1)][(a[m][2]-1)]+=a[m][3];
                        } q[i][(a[m][1]-1)][(a[m][2]-1)]+=a[m][3] q[i][(a[m][1]-1)][(a[m][2]-1)] q[i][(a[m][1]-1)] q[i] q i (a[m][1]-1) a[m][1] a[m] a m 1 1 (a[m][2]-1) a[m][2] a[m] a m 2 1 a[m][3] a[m] a m 3 for(k=0;k<3;k++){
                            for(l=0;l<10;l++){
                                 System.out.print(" " + q[i][k][l]);
                            }
                            System.out.printf("\n");
                        } k=0; k=0 k 0 k<3 k 3 k++ k++ k {
                            for(l=0;l<10;l++){
                                 System.out.print(" " + q[i][k][l]);
                            }
                            System.out.printf("\n");
                        } {
                            for(l=0;l<10;l++){
                                 System.out.print(" " + q[i][k][l]);
                            }
                            System.out.printf("\n");
                        } for(l=0;l<10;l++){
                                 System.out.print(" " + q[i][k][l]);
                            } l=0; l=0 l 0 l<10 l 10 l++ l++ l {
                                 System.out.print(" " + q[i][k][l]);
                            } {
                                 System.out.print(" " + q[i][k][l]);
                            } System.out.print(" " + q[i][k][l]) System.out.print System.out System System.out " " + q[i][k][l] " " q[i][k][l] q[i][k] q[i] q i k l System.out.printf("\n") System.out.printf System.out System System.out "\n" if(i==3){
                            System.exit(0);
                        }else{
                        System.out.println("####################");
                        } i==3 i 3 {
                            System.exit(0);
                        } System.exit(0) System.exit System 0 {
                        System.out.println("####################");
                        } System.out.println("####################") System.out.println System.out System System.out "####################" i++ i String[] args args public class Main{ 
        public static void main(String[] args){
            int i=0,j,k,l,m,o=0,p=0;
            int a[][];
            int q[][][];
            a = new int[1000][1000];
            q = new int[1000][10][10];
                Scanner n = new Scanner(System.in);
                int c = n.nextInt();
                while(i<c){
                     a[i][0] = n.nextInt();
                     for(j=1;j<4;j++){
                         a[i][j]=n.nextInt();
                     }
                     i++;
                }
                i=0;
                while(i<4){
                    for(m=0;m<c;m++){
                        if(((a[m][0])-1)==i){
                            q[i][(a[m][1]-1)][(a[m][2]-1)]+=a[m][3];
                        }
                    }
                        for(k=0;k<3;k++){
                            for(l=0;l<10;l++){
                                 System.out.print(" " + q[i][k][l]);
                            }
                            System.out.printf("\n");
                        }
                        if(i==3){
                            System.exit(0);
                        }else{
                        System.out.println("####################");
                        }
                     i++;
                }
        }
    } public class Main{ 
        public static void main(String[] args){
            int i=0,j,k,l,m,o=0,p=0;
            int a[][];
            int q[][][];
            a = new int[1000][1000];
            q = new int[1000][10][10];
                Scanner n = new Scanner(System.in);
                int c = n.nextInt();
                while(i<c){
                     a[i][0] = n.nextInt();
                     for(j=1;j<4;j++){
                         a[i][j]=n.nextInt();
                     }
                     i++;
                }
                i=0;
                while(i<4){
                    for(m=0;m<c;m++){
                        if(((a[m][0])-1)==i){
                            q[i][(a[m][1]-1)][(a[m][2]-1)]+=a[m][3];
                        }
                    }
                        for(k=0;k<3;k++){
                            for(l=0;l<10;l++){
                                 System.out.print(" " + q[i][k][l]);
                            }
                            System.out.printf("\n");
                        }
                        if(i==3){
                            System.exit(0);
                        }else{
                        System.out.println("####################");
                        }
                     i++;
                }
        }
    } Main
import java.util.Scanner;

public class Main{ 
        public static void main(String[] args){
            int i=0,j,k,l,m,o=0,p=0;
            int a[][];
            int q[][][];
            a = new int[1000][1000];
            q = new int[1000][10][10];
                Scanner n = new Scanner(System.in);
                int c = n.nextInt();
                while(i<c){
                     a[i][0] = n.nextInt();
                     for(j=1;j<4;j++){
                         a[i][j]=n.nextInt();
                     }
                     i++;
                }
                i=0;
                while(i<4){
                    for(m=0;m<c;m++){
                        if(((a[m][0])-1)==i){
                            q[i][(a[m][1]-1)][(a[m][2]-1)]+=a[m][3];
                        }
                    }
                        for(k=0;k<3;k++){
                            for(l=0;l<10;l++){
                                 System.out.print(" " + q[i][k][l]);
                            }
                            System.out.printf("\n");
                        }
                        if(i==3){
                            System.exit(0);
                        }else{
                        System.out.println("####################");
                        }
                     i++;
                }
        }
    }
