import java.util.Scanner;
public class Main {
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int [] [] [] buidings = new int[4][3][10];
        for(int b = 0; b < 4; b++){
            for(int f = 0;  f< 3; f++){
                for(int r = 0; r < 10; r++){
                    buidings [b] [f] [r] = 0;
                }
            }
        }
        for(int x = 0; x <n; x++){
            int b = scan.nextInt() - 1;
            int f = scan.nextInt() - 1;
            int r = scan.nextInt() - 1;
            int v = scan.nextInt();
            buidings [b] [f] [r] = buidings [b] [f] [r] + v;
        }
        for(int b = 0; b < 4; b++){
            for(int f = 0;  f< 3; f++){
                System.out.print(" ");
                for(int r = 0; r < 10; r++){
                    if(r == 9){
                        System.out.println(buidings [b] [f] [r]);
                    }
                    else {
                        System.out.print(buidings[b][f][r] + " ");
                    }
                }
            }
            if(b < 3) {
                System.out.println("####################");
            }
        }
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int [] [] [] buidings = new int[4][3][10];
        for(int b = 0; b < 4; b++){
            for(int f = 0;  f< 3; f++){
                for(int r = 0; r < 10; r++){
                    buidings [b] [f] [r] = 0;
                }
            }
        }
        for(int x = 0; x <n; x++){
            int b = scan.nextInt() - 1;
            int f = scan.nextInt() - 1;
            int r = scan.nextInt() - 1;
            int v = scan.nextInt();
            buidings [b] [f] [r] = buidings [b] [f] [r] + v;
        }
        for(int b = 0; b < 4; b++){
            for(int f = 0;  f< 3; f++){
                System.out.print(" ");
                for(int r = 0; r < 10; r++){
                    if(r == 9){
                        System.out.println(buidings [b] [f] [r]);
                    }
                    else {
                        System.out.print(buidings[b][f][r] + " ");
                    }
                }
            }
            if(b < 3) {
                System.out.println("####################");
            }
        }
    }
} Main public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int [] [] [] buidings = new int[4][3][10];
        for(int b = 0; b < 4; b++){
            for(int f = 0;  f< 3; f++){
                for(int r = 0; r < 10; r++){
                    buidings [b] [f] [r] = 0;
                }
            }
        }
        for(int x = 0; x <n; x++){
            int b = scan.nextInt() - 1;
            int f = scan.nextInt() - 1;
            int r = scan.nextInt() - 1;
            int v = scan.nextInt();
            buidings [b] [f] [r] = buidings [b] [f] [r] + v;
        }
        for(int b = 0; b < 4; b++){
            for(int f = 0;  f< 3; f++){
                System.out.print(" ");
                for(int r = 0; r < 10; r++){
                    if(r == 9){
                        System.out.println(buidings [b] [f] [r]);
                    }
                    else {
                        System.out.print(buidings[b][f][r] + " ");
                    }
                }
            }
            if(b < 3) {
                System.out.println("####################");
            }
        }
    } main {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int [] [] [] buidings = new int[4][3][10];
        for(int b = 0; b < 4; b++){
            for(int f = 0;  f< 3; f++){
                for(int r = 0; r < 10; r++){
                    buidings [b] [f] [r] = 0;
                }
            }
        }
        for(int x = 0; x <n; x++){
            int b = scan.nextInt() - 1;
            int f = scan.nextInt() - 1;
            int r = scan.nextInt() - 1;
            int v = scan.nextInt();
            buidings [b] [f] [r] = buidings [b] [f] [r] + v;
        }
        for(int b = 0; b < 4; b++){
            for(int f = 0;  f< 3; f++){
                System.out.print(" ");
                for(int r = 0; r < 10; r++){
                    if(r == 9){
                        System.out.println(buidings [b] [f] [r]);
                    }
                    else {
                        System.out.print(buidings[b][f][r] + " ");
                    }
                }
            }
            if(b < 3) {
                System.out.println("####################");
            }
        }
    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan int [] [] [] buidings = new int[4][3][10]; buidings new int[4][3][10] 4 3 10 for(int b = 0; b < 4; b++){
            for(int f = 0;  f< 3; f++){
                for(int r = 0; r < 10; r++){
                    buidings [b] [f] [r] = 0;
                }
            }
        } int b = 0; int b = 0; b 0 b < 4 b 4 b++ b++ b {
            for(int f = 0;  f< 3; f++){
                for(int r = 0; r < 10; r++){
                    buidings [b] [f] [r] = 0;
                }
            }
        } {
            for(int f = 0;  f< 3; f++){
                for(int r = 0; r < 10; r++){
                    buidings [b] [f] [r] = 0;
                }
            }
        } for(int f = 0;  f< 3; f++){
                for(int r = 0; r < 10; r++){
                    buidings [b] [f] [r] = 0;
                }
            } int f = 0; int f = 0; f 0 f< 3 f 3 f++ f++ f {
                for(int r = 0; r < 10; r++){
                    buidings [b] [f] [r] = 0;
                }
            } {
                for(int r = 0; r < 10; r++){
                    buidings [b] [f] [r] = 0;
                }
            } for(int r = 0; r < 10; r++){
                    buidings [b] [f] [r] = 0;
                } int r = 0; int r = 0; r 0 r < 10 r 10 r++ r++ r {
                    buidings [b] [f] [r] = 0;
                } {
                    buidings [b] [f] [r] = 0;
                } buidings [b] [f] [r] = 0 buidings [b] [f] [r] buidings [b] [f] buidings [b] buidings b f r 0 for(int x = 0; x <n; x++){
            int b = scan.nextInt() - 1;
            int f = scan.nextInt() - 1;
            int r = scan.nextInt() - 1;
            int v = scan.nextInt();
            buidings [b] [f] [r] = buidings [b] [f] [r] + v;
        } int x = 0; int x = 0; x 0 x <n x n x++ x++ x {
            int b = scan.nextInt() - 1;
            int f = scan.nextInt() - 1;
            int r = scan.nextInt() - 1;
            int v = scan.nextInt();
            buidings [b] [f] [r] = buidings [b] [f] [r] + v;
        } {
            int b = scan.nextInt() - 1;
            int f = scan.nextInt() - 1;
            int r = scan.nextInt() - 1;
            int v = scan.nextInt();
            buidings [b] [f] [r] = buidings [b] [f] [r] + v;
        } int b = scan.nextInt() - 1; b scan.nextInt() - 1 scan.nextInt() scan.nextInt scan 1 int f = scan.nextInt() - 1; f scan.nextInt() - 1 scan.nextInt() scan.nextInt scan 1 int r = scan.nextInt() - 1; r scan.nextInt() - 1 scan.nextInt() scan.nextInt scan 1 int v = scan.nextInt(); v scan.nextInt() scan.nextInt scan buidings [b] [f] [r] = buidings [b] [f] [r] + v buidings [b] [f] [r] buidings [b] [f] buidings [b] buidings b f r buidings [b] [f] [r] + v buidings [b] [f] [r] buidings [b] [f] buidings [b] buidings b f r v for(int b = 0; b < 4; b++){
            for(int f = 0;  f< 3; f++){
                System.out.print(" ");
                for(int r = 0; r < 10; r++){
                    if(r == 9){
                        System.out.println(buidings [b] [f] [r]);
                    }
                    else {
                        System.out.print(buidings[b][f][r] + " ");
                    }
                }
            }
            if(b < 3) {
                System.out.println("####################");
            }
        } int b = 0; int b = 0; b 0 b < 4 b 4 b++ b++ b {
            for(int f = 0;  f< 3; f++){
                System.out.print(" ");
                for(int r = 0; r < 10; r++){
                    if(r == 9){
                        System.out.println(buidings [b] [f] [r]);
                    }
                    else {
                        System.out.print(buidings[b][f][r] + " ");
                    }
                }
            }
            if(b < 3) {
                System.out.println("####################");
            }
        } {
            for(int f = 0;  f< 3; f++){
                System.out.print(" ");
                for(int r = 0; r < 10; r++){
                    if(r == 9){
                        System.out.println(buidings [b] [f] [r]);
                    }
                    else {
                        System.out.print(buidings[b][f][r] + " ");
                    }
                }
            }
            if(b < 3) {
                System.out.println("####################");
            }
        } for(int f = 0;  f< 3; f++){
                System.out.print(" ");
                for(int r = 0; r < 10; r++){
                    if(r == 9){
                        System.out.println(buidings [b] [f] [r]);
                    }
                    else {
                        System.out.print(buidings[b][f][r] + " ");
                    }
                }
            } int f = 0; int f = 0; f 0 f< 3 f 3 f++ f++ f {
                System.out.print(" ");
                for(int r = 0; r < 10; r++){
                    if(r == 9){
                        System.out.println(buidings [b] [f] [r]);
                    }
                    else {
                        System.out.print(buidings[b][f][r] + " ");
                    }
                }
            } {
                System.out.print(" ");
                for(int r = 0; r < 10; r++){
                    if(r == 9){
                        System.out.println(buidings [b] [f] [r]);
                    }
                    else {
                        System.out.print(buidings[b][f][r] + " ");
                    }
                }
            } System.out.print(" ") System.out.print System.out System System.out " " for(int r = 0; r < 10; r++){
                    if(r == 9){
                        System.out.println(buidings [b] [f] [r]);
                    }
                    else {
                        System.out.print(buidings[b][f][r] + " ");
                    }
                } int r = 0; int r = 0; r 0 r < 10 r 10 r++ r++ r {
                    if(r == 9){
                        System.out.println(buidings [b] [f] [r]);
                    }
                    else {
                        System.out.print(buidings[b][f][r] + " ");
                    }
                } {
                    if(r == 9){
                        System.out.println(buidings [b] [f] [r]);
                    }
                    else {
                        System.out.print(buidings[b][f][r] + " ");
                    }
                } if(r == 9){
                        System.out.println(buidings [b] [f] [r]);
                    }
                    else {
                        System.out.print(buidings[b][f][r] + " ");
                    } r == 9 r 9 {
                        System.out.println(buidings [b] [f] [r]);
                    } System.out.println(buidings [b] [f] [r]) System.out.println System.out System System.out buidings [b] [f] [r] buidings [b] [f] buidings [b] buidings b f r {
                        System.out.print(buidings[b][f][r] + " ");
                    } System.out.print(buidings[b][f][r] + " ") System.out.print System.out System System.out buidings[b][f][r] + " " buidings[b][f][r] buidings[b][f] buidings[b] buidings b f r " " if(b < 3) {
                System.out.println("####################");
            } b < 3 b 3 {
                System.out.println("####################");
            } System.out.println("####################") System.out.println System.out System System.out "####################" String[] args args public class Main {
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int [] [] [] buidings = new int[4][3][10];
        for(int b = 0; b < 4; b++){
            for(int f = 0;  f< 3; f++){
                for(int r = 0; r < 10; r++){
                    buidings [b] [f] [r] = 0;
                }
            }
        }
        for(int x = 0; x <n; x++){
            int b = scan.nextInt() - 1;
            int f = scan.nextInt() - 1;
            int r = scan.nextInt() - 1;
            int v = scan.nextInt();
            buidings [b] [f] [r] = buidings [b] [f] [r] + v;
        }
        for(int b = 0; b < 4; b++){
            for(int f = 0;  f< 3; f++){
                System.out.print(" ");
                for(int r = 0; r < 10; r++){
                    if(r == 9){
                        System.out.println(buidings [b] [f] [r]);
                    }
                    else {
                        System.out.print(buidings[b][f][r] + " ");
                    }
                }
            }
            if(b < 3) {
                System.out.println("####################");
            }
        }
    }
} public class Main {
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int [] [] [] buidings = new int[4][3][10];
        for(int b = 0; b < 4; b++){
            for(int f = 0;  f< 3; f++){
                for(int r = 0; r < 10; r++){
                    buidings [b] [f] [r] = 0;
                }
            }
        }
        for(int x = 0; x <n; x++){
            int b = scan.nextInt() - 1;
            int f = scan.nextInt() - 1;
            int r = scan.nextInt() - 1;
            int v = scan.nextInt();
            buidings [b] [f] [r] = buidings [b] [f] [r] + v;
        }
        for(int b = 0; b < 4; b++){
            for(int f = 0;  f< 3; f++){
                System.out.print(" ");
                for(int r = 0; r < 10; r++){
                    if(r == 9){
                        System.out.println(buidings [b] [f] [r]);
                    }
                    else {
                        System.out.print(buidings[b][f][r] + " ");
                    }
                }
            }
            if(b < 3) {
                System.out.println("####################");
            }
        }
    }
} Main
import java.util.Scanner;
public class Main {
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int [] [] [] buidings = new int[4][3][10];
        for(int b = 0; b < 4; b++){
            for(int f = 0;  f< 3; f++){
                for(int r = 0; r < 10; r++){
                    buidings [b] [f] [r] = 0;
                }
            }
        }
        for(int x = 0; x <n; x++){
            int b = scan.nextInt() - 1;
            int f = scan.nextInt() - 1;
            int r = scan.nextInt() - 1;
            int v = scan.nextInt();
            buidings [b] [f] [r] = buidings [b] [f] [r] + v;
        }
        for(int b = 0; b < 4; b++){
            for(int f = 0;  f< 3; f++){
                System.out.print(" ");
                for(int r = 0; r < 10; r++){
                    if(r == 9){
                        System.out.println(buidings [b] [f] [r]);
                    }
                    else {
                        System.out.print(buidings[b][f][r] + " ");
                    }
                }
            }
            if(b < 3) {
                System.out.println("####################");
            }
        }
    }
}
