import java.util.Scanner;

public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int building[][][]= new int[4][3][10];
        int n=sc.nextInt();
        while(n-->0){
            building[sc.nextInt()-1][sc.nextInt()-1][sc.nextInt()-1]+=sc.nextInt();
        }
        for(int i=0;i<4;i++) {
            for (int j = 0; j < 3; j++) {
                for (int k = 0; k < 10; k++) {
                    System.out.print(" "+building[i][j][k]);
                }
                System.out.println();
            }
            if(i<3){
                for (int k = 0; k < 20; k++)System.out.print("#");
                System.out.println();
            }
        }
    }
}

 import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int building[][][]= new int[4][3][10];
        int n=sc.nextInt();
        while(n-->0){
            building[sc.nextInt()-1][sc.nextInt()-1][sc.nextInt()-1]+=sc.nextInt();
        }
        for(int i=0;i<4;i++) {
            for (int j = 0; j < 3; j++) {
                for (int k = 0; k < 10; k++) {
                    System.out.print(" "+building[i][j][k]);
                }
                System.out.println();
            }
            if(i<3){
                for (int k = 0; k < 20; k++)System.out.print("#");
                System.out.println();
            }
        }
    }
} Main public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int building[][][]= new int[4][3][10];
        int n=sc.nextInt();
        while(n-->0){
            building[sc.nextInt()-1][sc.nextInt()-1][sc.nextInt()-1]+=sc.nextInt();
        }
        for(int i=0;i<4;i++) {
            for (int j = 0; j < 3; j++) {
                for (int k = 0; k < 10; k++) {
                    System.out.print(" "+building[i][j][k]);
                }
                System.out.println();
            }
            if(i<3){
                for (int k = 0; k < 20; k++)System.out.print("#");
                System.out.println();
            }
        }
    } main {
        Scanner sc = new Scanner(System.in);
        int building[][][]= new int[4][3][10];
        int n=sc.nextInt();
        while(n-->0){
            building[sc.nextInt()-1][sc.nextInt()-1][sc.nextInt()-1]+=sc.nextInt();
        }
        for(int i=0;i<4;i++) {
            for (int j = 0; j < 3; j++) {
                for (int k = 0; k < 10; k++) {
                    System.out.print(" "+building[i][j][k]);
                }
                System.out.println();
            }
            if(i<3){
                for (int k = 0; k < 20; k++)System.out.print("#");
                System.out.println();
            }
        }
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int building[][][]= new int[4][3][10]; building new int[4][3][10] 4 3 10 int n=sc.nextInt(); n sc.nextInt() sc.nextInt sc while(n-->0){
            building[sc.nextInt()-1][sc.nextInt()-1][sc.nextInt()-1]+=sc.nextInt();
        } n-->0 n-- n 0 {
            building[sc.nextInt()-1][sc.nextInt()-1][sc.nextInt()-1]+=sc.nextInt();
        } building[sc.nextInt()-1][sc.nextInt()-1][sc.nextInt()-1]+=sc.nextInt() building[sc.nextInt()-1][sc.nextInt()-1][sc.nextInt()-1] building[sc.nextInt()-1][sc.nextInt()-1] building[sc.nextInt()-1] building sc.nextInt()-1 sc.nextInt() sc.nextInt sc 1 sc.nextInt()-1 sc.nextInt() sc.nextInt sc 1 sc.nextInt()-1 sc.nextInt() sc.nextInt sc 1 sc.nextInt() sc.nextInt sc for(int i=0;i<4;i++) {
            for (int j = 0; j < 3; j++) {
                for (int k = 0; k < 10; k++) {
                    System.out.print(" "+building[i][j][k]);
                }
                System.out.println();
            }
            if(i<3){
                for (int k = 0; k < 20; k++)System.out.print("#");
                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(" "+building[i][j][k]);
                }
                System.out.println();
            }
            if(i<3){
                for (int k = 0; k < 20; k++)System.out.print("#");
                System.out.println();
            }
        } {
            for (int j = 0; j < 3; j++) {
                for (int k = 0; k < 10; k++) {
                    System.out.print(" "+building[i][j][k]);
                }
                System.out.println();
            }
            if(i<3){
                for (int k = 0; k < 20; k++)System.out.print("#");
                System.out.println();
            }
        } for (int j = 0; j < 3; j++) {
                for (int k = 0; k < 10; k++) {
                    System.out.print(" "+building[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(" "+building[i][j][k]);
                }
                System.out.println();
            } {
                for (int k = 0; k < 10; k++) {
                    System.out.print(" "+building[i][j][k]);
                }
                System.out.println();
            } for (int k = 0; k < 10; k++) {
                    System.out.print(" "+building[i][j][k]);
                } int k = 0; int k = 0; k 0 k < 10 k 10 k++ k++ k {
                    System.out.print(" "+building[i][j][k]);
                } {
                    System.out.print(" "+building[i][j][k]);
                } System.out.print(" "+building[i][j][k]) System.out.print System.out System System.out " "+building[i][j][k] " " building[i][j][k] building[i][j] building[i] building i j k System.out.println() System.out.println System.out System System.out if(i<3){
                for (int k = 0; k < 20; k++)System.out.print("#");
                System.out.println();
            } i<3 i 3 {
                for (int k = 0; k < 20; k++)System.out.print("#");
                System.out.println();
            } for (int k = 0; k < 20; k++)System.out.print("#"); int k = 0; int k = 0; k 0 k < 20 k 20 k++ k++ k System.out.print("#"); System.out.print("#") System.out.print System.out System System.out "#" System.out.println() System.out.println System.out System System.out String[] args args public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int building[][][]= new int[4][3][10];
        int n=sc.nextInt();
        while(n-->0){
            building[sc.nextInt()-1][sc.nextInt()-1][sc.nextInt()-1]+=sc.nextInt();
        }
        for(int i=0;i<4;i++) {
            for (int j = 0; j < 3; j++) {
                for (int k = 0; k < 10; k++) {
                    System.out.print(" "+building[i][j][k]);
                }
                System.out.println();
            }
            if(i<3){
                for (int k = 0; k < 20; k++)System.out.print("#");
                System.out.println();
            }
        }
    }
} public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int building[][][]= new int[4][3][10];
        int n=sc.nextInt();
        while(n-->0){
            building[sc.nextInt()-1][sc.nextInt()-1][sc.nextInt()-1]+=sc.nextInt();
        }
        for(int i=0;i<4;i++) {
            for (int j = 0; j < 3; j++) {
                for (int k = 0; k < 10; k++) {
                    System.out.print(" "+building[i][j][k]);
                }
                System.out.println();
            }
            if(i<3){
                for (int k = 0; k < 20; k++)System.out.print("#");
                System.out.println();
            }
        }
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int building[][][]= new int[4][3][10];
        int n=sc.nextInt();
        while(n-->0){
            building[sc.nextInt()-1][sc.nextInt()-1][sc.nextInt()-1]+=sc.nextInt();
        }
        for(int i=0;i<4;i++) {
            for (int j = 0; j < 3; j++) {
                for (int k = 0; k < 10; k++) {
                    System.out.print(" "+building[i][j][k]);
                }
                System.out.println();
            }
            if(i<3){
                for (int k = 0; k < 20; k++)System.out.print("#");
                System.out.println();
            }
        }
    }
}


