import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int[][] intTouA=new int[3][10];
        int[][] intTouB=new int[3][10];
        int[][] intTouC=new int[3][10];
        int[][] intTouD=new int[3][10];
        for(int i=0; i<3;i++){
            for(int j=0; j<10;j++){
            intTouA[i][j]=0;
            intTouB[i][j]=0;
            intTouC[i][j]=0;
            intTouD[i][j]=0;
            }
        }
        int a=scanner.nextInt();
        for(int i=0; i<a;i++){
            int tou=scanner.nextInt();
            int kai=scanner.nextInt();
            int ban=scanner.nextInt();
            int ninzu=scanner.nextInt();
            
            if(tou==1){
                intTouA[(kai-1)][(ban-1)]+=ninzu;
            }
            if(tou==2){
                intTouB[(kai-1)][(ban-1)]+=ninzu;
            }
            if(tou==3){
                intTouC[(kai-1)][(ban-1)]+=ninzu;
            }
            if(tou==4){
                intTouD[(kai-1)][(ban-1)]+=ninzu;
            }
        }
        
        for(int i=0; i<3;i++){
            for(int j=0; j<10;j++){
                System.out.print(" "+intTouA[i][j]);
            }
            System.out.println("");
        }
        System.out.println("####################");
        for(int i=0; i<3;i++){
            for(int j=0; j<10;j++){
                System.out.print(" "+intTouB[i][j]);
            }
            System.out.println("");
        }
        System.out.println("####################");
        for(int i=0; i<3;i++){
            for(int j=0; j<10;j++){
                System.out.print(" "+intTouC[i][j]);
            }
            System.out.println("");
        }
        System.out.println("####################");
        for(int i=0; i<3;i++){
            for(int j=0; j<10;j++){
                System.out.print(" "+intTouD[i][j]);
            }
            System.out.println("");
        }
    }
} import java.util.Scanner; Scanner java.util public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int[][] intTouA=new int[3][10];
        int[][] intTouB=new int[3][10];
        int[][] intTouC=new int[3][10];
        int[][] intTouD=new int[3][10];
        for(int i=0; i<3;i++){
            for(int j=0; j<10;j++){
            intTouA[i][j]=0;
            intTouB[i][j]=0;
            intTouC[i][j]=0;
            intTouD[i][j]=0;
            }
        }
        int a=scanner.nextInt();
        for(int i=0; i<a;i++){
            int tou=scanner.nextInt();
            int kai=scanner.nextInt();
            int ban=scanner.nextInt();
            int ninzu=scanner.nextInt();
            
            if(tou==1){
                intTouA[(kai-1)][(ban-1)]+=ninzu;
            }
            if(tou==2){
                intTouB[(kai-1)][(ban-1)]+=ninzu;
            }
            if(tou==3){
                intTouC[(kai-1)][(ban-1)]+=ninzu;
            }
            if(tou==4){
                intTouD[(kai-1)][(ban-1)]+=ninzu;
            }
        }
        
        for(int i=0; i<3;i++){
            for(int j=0; j<10;j++){
                System.out.print(" "+intTouA[i][j]);
            }
            System.out.println("");
        }
        System.out.println("####################");
        for(int i=0; i<3;i++){
            for(int j=0; j<10;j++){
                System.out.print(" "+intTouB[i][j]);
            }
            System.out.println("");
        }
        System.out.println("####################");
        for(int i=0; i<3;i++){
            for(int j=0; j<10;j++){
                System.out.print(" "+intTouC[i][j]);
            }
            System.out.println("");
        }
        System.out.println("####################");
        for(int i=0; i<3;i++){
            for(int j=0; j<10;j++){
                System.out.print(" "+intTouD[i][j]);
            }
            System.out.println("");
        }
    }
} Main public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int[][] intTouA=new int[3][10];
        int[][] intTouB=new int[3][10];
        int[][] intTouC=new int[3][10];
        int[][] intTouD=new int[3][10];
        for(int i=0; i<3;i++){
            for(int j=0; j<10;j++){
            intTouA[i][j]=0;
            intTouB[i][j]=0;
            intTouC[i][j]=0;
            intTouD[i][j]=0;
            }
        }
        int a=scanner.nextInt();
        for(int i=0; i<a;i++){
            int tou=scanner.nextInt();
            int kai=scanner.nextInt();
            int ban=scanner.nextInt();
            int ninzu=scanner.nextInt();
            
            if(tou==1){
                intTouA[(kai-1)][(ban-1)]+=ninzu;
            }
            if(tou==2){
                intTouB[(kai-1)][(ban-1)]+=ninzu;
            }
            if(tou==3){
                intTouC[(kai-1)][(ban-1)]+=ninzu;
            }
            if(tou==4){
                intTouD[(kai-1)][(ban-1)]+=ninzu;
            }
        }
        
        for(int i=0; i<3;i++){
            for(int j=0; j<10;j++){
                System.out.print(" "+intTouA[i][j]);
            }
            System.out.println("");
        }
        System.out.println("####################");
        for(int i=0; i<3;i++){
            for(int j=0; j<10;j++){
                System.out.print(" "+intTouB[i][j]);
            }
            System.out.println("");
        }
        System.out.println("####################");
        for(int i=0; i<3;i++){
            for(int j=0; j<10;j++){
                System.out.print(" "+intTouC[i][j]);
            }
            System.out.println("");
        }
        System.out.println("####################");
        for(int i=0; i<3;i++){
            for(int j=0; j<10;j++){
                System.out.print(" "+intTouD[i][j]);
            }
            System.out.println("");
        }
    } main {
        Scanner scanner = new Scanner(System.in);
        int[][] intTouA=new int[3][10];
        int[][] intTouB=new int[3][10];
        int[][] intTouC=new int[3][10];
        int[][] intTouD=new int[3][10];
        for(int i=0; i<3;i++){
            for(int j=0; j<10;j++){
            intTouA[i][j]=0;
            intTouB[i][j]=0;
            intTouC[i][j]=0;
            intTouD[i][j]=0;
            }
        }
        int a=scanner.nextInt();
        for(int i=0; i<a;i++){
            int tou=scanner.nextInt();
            int kai=scanner.nextInt();
            int ban=scanner.nextInt();
            int ninzu=scanner.nextInt();
            
            if(tou==1){
                intTouA[(kai-1)][(ban-1)]+=ninzu;
            }
            if(tou==2){
                intTouB[(kai-1)][(ban-1)]+=ninzu;
            }
            if(tou==3){
                intTouC[(kai-1)][(ban-1)]+=ninzu;
            }
            if(tou==4){
                intTouD[(kai-1)][(ban-1)]+=ninzu;
            }
        }
        
        for(int i=0; i<3;i++){
            for(int j=0; j<10;j++){
                System.out.print(" "+intTouA[i][j]);
            }
            System.out.println("");
        }
        System.out.println("####################");
        for(int i=0; i<3;i++){
            for(int j=0; j<10;j++){
                System.out.print(" "+intTouB[i][j]);
            }
            System.out.println("");
        }
        System.out.println("####################");
        for(int i=0; i<3;i++){
            for(int j=0; j<10;j++){
                System.out.print(" "+intTouC[i][j]);
            }
            System.out.println("");
        }
        System.out.println("####################");
        for(int i=0; i<3;i++){
            for(int j=0; j<10;j++){
                System.out.print(" "+intTouD[i][j]);
            }
            System.out.println("");
        }
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int[][] intTouA=new int[3][10]; intTouA new int[3][10] 3 10 int[][] intTouB=new int[3][10]; intTouB new int[3][10] 3 10 int[][] intTouC=new int[3][10]; intTouC new int[3][10] 3 10 int[][] intTouD=new int[3][10]; intTouD new int[3][10] 3 10 for(int i=0; i<3;i++){
            for(int j=0; j<10;j++){
            intTouA[i][j]=0;
            intTouB[i][j]=0;
            intTouC[i][j]=0;
            intTouD[i][j]=0;
            }
        } int i=0; int i=0; i 0 i<3 i 3 i++ i++ i {
            for(int j=0; j<10;j++){
            intTouA[i][j]=0;
            intTouB[i][j]=0;
            intTouC[i][j]=0;
            intTouD[i][j]=0;
            }
        } {
            for(int j=0; j<10;j++){
            intTouA[i][j]=0;
            intTouB[i][j]=0;
            intTouC[i][j]=0;
            intTouD[i][j]=0;
            }
        } for(int j=0; j<10;j++){
            intTouA[i][j]=0;
            intTouB[i][j]=0;
            intTouC[i][j]=0;
            intTouD[i][j]=0;
            } int j=0; int j=0; j 0 j<10 j 10 j++ j++ j {
            intTouA[i][j]=0;
            intTouB[i][j]=0;
            intTouC[i][j]=0;
            intTouD[i][j]=0;
            } {
            intTouA[i][j]=0;
            intTouB[i][j]=0;
            intTouC[i][j]=0;
            intTouD[i][j]=0;
            } intTouA[i][j]=0 intTouA[i][j] intTouA[i] intTouA i j 0 intTouB[i][j]=0 intTouB[i][j] intTouB[i] intTouB i j 0 intTouC[i][j]=0 intTouC[i][j] intTouC[i] intTouC i j 0 intTouD[i][j]=0 intTouD[i][j] intTouD[i] intTouD i j 0 int a=scanner.nextInt(); a scanner.nextInt() scanner.nextInt scanner for(int i=0; i<a;i++){
            int tou=scanner.nextInt();
            int kai=scanner.nextInt();
            int ban=scanner.nextInt();
            int ninzu=scanner.nextInt();
            
            if(tou==1){
                intTouA[(kai-1)][(ban-1)]+=ninzu;
            }
            if(tou==2){
                intTouB[(kai-1)][(ban-1)]+=ninzu;
            }
            if(tou==3){
                intTouC[(kai-1)][(ban-1)]+=ninzu;
            }
            if(tou==4){
                intTouD[(kai-1)][(ban-1)]+=ninzu;
            }
        } int i=0; int i=0; i 0 i<a i a i++ i++ i {
            int tou=scanner.nextInt();
            int kai=scanner.nextInt();
            int ban=scanner.nextInt();
            int ninzu=scanner.nextInt();
            
            if(tou==1){
                intTouA[(kai-1)][(ban-1)]+=ninzu;
            }
            if(tou==2){
                intTouB[(kai-1)][(ban-1)]+=ninzu;
            }
            if(tou==3){
                intTouC[(kai-1)][(ban-1)]+=ninzu;
            }
            if(tou==4){
                intTouD[(kai-1)][(ban-1)]+=ninzu;
            }
        } {
            int tou=scanner.nextInt();
            int kai=scanner.nextInt();
            int ban=scanner.nextInt();
            int ninzu=scanner.nextInt();
            
            if(tou==1){
                intTouA[(kai-1)][(ban-1)]+=ninzu;
            }
            if(tou==2){
                intTouB[(kai-1)][(ban-1)]+=ninzu;
            }
            if(tou==3){
                intTouC[(kai-1)][(ban-1)]+=ninzu;
            }
            if(tou==4){
                intTouD[(kai-1)][(ban-1)]+=ninzu;
            }
        } int tou=scanner.nextInt(); tou scanner.nextInt() scanner.nextInt scanner int kai=scanner.nextInt(); kai scanner.nextInt() scanner.nextInt scanner int ban=scanner.nextInt(); ban scanner.nextInt() scanner.nextInt scanner int ninzu=scanner.nextInt(); ninzu scanner.nextInt() scanner.nextInt scanner if(tou==1){
                intTouA[(kai-1)][(ban-1)]+=ninzu;
            } tou==1 tou 1 {
                intTouA[(kai-1)][(ban-1)]+=ninzu;
            } intTouA[(kai-1)][(ban-1)]+=ninzu intTouA[(kai-1)][(ban-1)] intTouA[(kai-1)] intTouA (kai-1) kai 1 (ban-1) ban 1 ninzu if(tou==2){
                intTouB[(kai-1)][(ban-1)]+=ninzu;
            } tou==2 tou 2 {
                intTouB[(kai-1)][(ban-1)]+=ninzu;
            } intTouB[(kai-1)][(ban-1)]+=ninzu intTouB[(kai-1)][(ban-1)] intTouB[(kai-1)] intTouB (kai-1) kai 1 (ban-1) ban 1 ninzu if(tou==3){
                intTouC[(kai-1)][(ban-1)]+=ninzu;
            } tou==3 tou 3 {
                intTouC[(kai-1)][(ban-1)]+=ninzu;
            } intTouC[(kai-1)][(ban-1)]+=ninzu intTouC[(kai-1)][(ban-1)] intTouC[(kai-1)] intTouC (kai-1) kai 1 (ban-1) ban 1 ninzu if(tou==4){
                intTouD[(kai-1)][(ban-1)]+=ninzu;
            } tou==4 tou 4 {
                intTouD[(kai-1)][(ban-1)]+=ninzu;
            } intTouD[(kai-1)][(ban-1)]+=ninzu intTouD[(kai-1)][(ban-1)] intTouD[(kai-1)] intTouD (kai-1) kai 1 (ban-1) ban 1 ninzu for(int i=0; i<3;i++){
            for(int j=0; j<10;j++){
                System.out.print(" "+intTouA[i][j]);
            }
            System.out.println("");
        } int i=0; int i=0; i 0 i<3 i 3 i++ i++ i {
            for(int j=0; j<10;j++){
                System.out.print(" "+intTouA[i][j]);
            }
            System.out.println("");
        } {
            for(int j=0; j<10;j++){
                System.out.print(" "+intTouA[i][j]);
            }
            System.out.println("");
        } for(int j=0; j<10;j++){
                System.out.print(" "+intTouA[i][j]);
            } int j=0; int j=0; j 0 j<10 j 10 j++ j++ j {
                System.out.print(" "+intTouA[i][j]);
            } {
                System.out.print(" "+intTouA[i][j]);
            } System.out.print(" "+intTouA[i][j]) System.out.print System.out System System.out " "+intTouA[i][j] " " intTouA[i][j] intTouA[i] intTouA 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=0; i<3;i++){
            for(int j=0; j<10;j++){
                System.out.print(" "+intTouB[i][j]);
            }
            System.out.println("");
        } int i=0; int i=0; i 0 i<3 i 3 i++ i++ i {
            for(int j=0; j<10;j++){
                System.out.print(" "+intTouB[i][j]);
            }
            System.out.println("");
        } {
            for(int j=0; j<10;j++){
                System.out.print(" "+intTouB[i][j]);
            }
            System.out.println("");
        } for(int j=0; j<10;j++){
                System.out.print(" "+intTouB[i][j]);
            } int j=0; int j=0; j 0 j<10 j 10 j++ j++ j {
                System.out.print(" "+intTouB[i][j]);
            } {
                System.out.print(" "+intTouB[i][j]);
            } System.out.print(" "+intTouB[i][j]) System.out.print System.out System System.out " "+intTouB[i][j] " " intTouB[i][j] intTouB[i] intTouB 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=0; i<3;i++){
            for(int j=0; j<10;j++){
                System.out.print(" "+intTouC[i][j]);
            }
            System.out.println("");
        } int i=0; int i=0; i 0 i<3 i 3 i++ i++ i {
            for(int j=0; j<10;j++){
                System.out.print(" "+intTouC[i][j]);
            }
            System.out.println("");
        } {
            for(int j=0; j<10;j++){
                System.out.print(" "+intTouC[i][j]);
            }
            System.out.println("");
        } for(int j=0; j<10;j++){
                System.out.print(" "+intTouC[i][j]);
            } int j=0; int j=0; j 0 j<10 j 10 j++ j++ j {
                System.out.print(" "+intTouC[i][j]);
            } {
                System.out.print(" "+intTouC[i][j]);
            } System.out.print(" "+intTouC[i][j]) System.out.print System.out System System.out " "+intTouC[i][j] " " intTouC[i][j] intTouC[i] intTouC 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=0; i<3;i++){
            for(int j=0; j<10;j++){
                System.out.print(" "+intTouD[i][j]);
            }
            System.out.println("");
        } int i=0; int i=0; i 0 i<3 i 3 i++ i++ i {
            for(int j=0; j<10;j++){
                System.out.print(" "+intTouD[i][j]);
            }
            System.out.println("");
        } {
            for(int j=0; j<10;j++){
                System.out.print(" "+intTouD[i][j]);
            }
            System.out.println("");
        } for(int j=0; j<10;j++){
                System.out.print(" "+intTouD[i][j]);
            } int j=0; int j=0; j 0 j<10 j 10 j++ j++ j {
                System.out.print(" "+intTouD[i][j]);
            } {
                System.out.print(" "+intTouD[i][j]);
            } System.out.print(" "+intTouD[i][j]) System.out.print System.out System System.out " "+intTouD[i][j] " " intTouD[i][j] intTouD[i] intTouD 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 scanner = new Scanner(System.in);
        int[][] intTouA=new int[3][10];
        int[][] intTouB=new int[3][10];
        int[][] intTouC=new int[3][10];
        int[][] intTouD=new int[3][10];
        for(int i=0; i<3;i++){
            for(int j=0; j<10;j++){
            intTouA[i][j]=0;
            intTouB[i][j]=0;
            intTouC[i][j]=0;
            intTouD[i][j]=0;
            }
        }
        int a=scanner.nextInt();
        for(int i=0; i<a;i++){
            int tou=scanner.nextInt();
            int kai=scanner.nextInt();
            int ban=scanner.nextInt();
            int ninzu=scanner.nextInt();
            
            if(tou==1){
                intTouA[(kai-1)][(ban-1)]+=ninzu;
            }
            if(tou==2){
                intTouB[(kai-1)][(ban-1)]+=ninzu;
            }
            if(tou==3){
                intTouC[(kai-1)][(ban-1)]+=ninzu;
            }
            if(tou==4){
                intTouD[(kai-1)][(ban-1)]+=ninzu;
            }
        }
        
        for(int i=0; i<3;i++){
            for(int j=0; j<10;j++){
                System.out.print(" "+intTouA[i][j]);
            }
            System.out.println("");
        }
        System.out.println("####################");
        for(int i=0; i<3;i++){
            for(int j=0; j<10;j++){
                System.out.print(" "+intTouB[i][j]);
            }
            System.out.println("");
        }
        System.out.println("####################");
        for(int i=0; i<3;i++){
            for(int j=0; j<10;j++){
                System.out.print(" "+intTouC[i][j]);
            }
            System.out.println("");
        }
        System.out.println("####################");
        for(int i=0; i<3;i++){
            for(int j=0; j<10;j++){
                System.out.print(" "+intTouD[i][j]);
            }
            System.out.println("");
        }
    }
} public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int[][] intTouA=new int[3][10];
        int[][] intTouB=new int[3][10];
        int[][] intTouC=new int[3][10];
        int[][] intTouD=new int[3][10];
        for(int i=0; i<3;i++){
            for(int j=0; j<10;j++){
            intTouA[i][j]=0;
            intTouB[i][j]=0;
            intTouC[i][j]=0;
            intTouD[i][j]=0;
            }
        }
        int a=scanner.nextInt();
        for(int i=0; i<a;i++){
            int tou=scanner.nextInt();
            int kai=scanner.nextInt();
            int ban=scanner.nextInt();
            int ninzu=scanner.nextInt();
            
            if(tou==1){
                intTouA[(kai-1)][(ban-1)]+=ninzu;
            }
            if(tou==2){
                intTouB[(kai-1)][(ban-1)]+=ninzu;
            }
            if(tou==3){
                intTouC[(kai-1)][(ban-1)]+=ninzu;
            }
            if(tou==4){
                intTouD[(kai-1)][(ban-1)]+=ninzu;
            }
        }
        
        for(int i=0; i<3;i++){
            for(int j=0; j<10;j++){
                System.out.print(" "+intTouA[i][j]);
            }
            System.out.println("");
        }
        System.out.println("####################");
        for(int i=0; i<3;i++){
            for(int j=0; j<10;j++){
                System.out.print(" "+intTouB[i][j]);
            }
            System.out.println("");
        }
        System.out.println("####################");
        for(int i=0; i<3;i++){
            for(int j=0; j<10;j++){
                System.out.print(" "+intTouC[i][j]);
            }
            System.out.println("");
        }
        System.out.println("####################");
        for(int i=0; i<3;i++){
            for(int j=0; j<10;j++){
                System.out.print(" "+intTouD[i][j]);
            }
            System.out.println("");
        }
    }
} Main
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int[][] intTouA=new int[3][10];
        int[][] intTouB=new int[3][10];
        int[][] intTouC=new int[3][10];
        int[][] intTouD=new int[3][10];
        for(int i=0; i<3;i++){
            for(int j=0; j<10;j++){
            intTouA[i][j]=0;
            intTouB[i][j]=0;
            intTouC[i][j]=0;
            intTouD[i][j]=0;
            }
        }
        int a=scanner.nextInt();
        for(int i=0; i<a;i++){
            int tou=scanner.nextInt();
            int kai=scanner.nextInt();
            int ban=scanner.nextInt();
            int ninzu=scanner.nextInt();
            
            if(tou==1){
                intTouA[(kai-1)][(ban-1)]+=ninzu;
            }
            if(tou==2){
                intTouB[(kai-1)][(ban-1)]+=ninzu;
            }
            if(tou==3){
                intTouC[(kai-1)][(ban-1)]+=ninzu;
            }
            if(tou==4){
                intTouD[(kai-1)][(ban-1)]+=ninzu;
            }
        }
        
        for(int i=0; i<3;i++){
            for(int j=0; j<10;j++){
                System.out.print(" "+intTouA[i][j]);
            }
            System.out.println("");
        }
        System.out.println("####################");
        for(int i=0; i<3;i++){
            for(int j=0; j<10;j++){
                System.out.print(" "+intTouB[i][j]);
            }
            System.out.println("");
        }
        System.out.println("####################");
        for(int i=0; i<3;i++){
            for(int j=0; j<10;j++){
                System.out.print(" "+intTouC[i][j]);
            }
            System.out.println("");
        }
        System.out.println("####################");
        for(int i=0; i<3;i++){
            for(int j=0; j<10;j++){
                System.out.print(" "+intTouD[i][j]);
            }
            System.out.println("");
        }
    }
}