import java.util.Scanner;

public class Main {
    public static void main(String[] args) {

        Scanner scn = new Scanner(System.in);
        int count = scn.nextInt();

        int[][][] array;
        array = new int[4][3][10];

        for(int i = 0; i < count; i++){
            int b = scn.nextInt();
            int f = scn.nextInt();
            int r = scn.nextInt();
            int v = scn.nextInt();
            array[b - 1][f -1][r -1] += v;
        }


        for(int i = 0; i < 4; i++){
            for(int j = 0; j < 3; j++){
                for(int k = 0; k < 10; k++){
                    System.out.printf(" %d",array[i][j][k]);
                }
                System.out.printf("\n");
            }
            if(i != 3) System.out.printf("####################\n");
        }

    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {

        Scanner scn = new Scanner(System.in);
        int count = scn.nextInt();

        int[][][] array;
        array = new int[4][3][10];

        for(int i = 0; i < count; i++){
            int b = scn.nextInt();
            int f = scn.nextInt();
            int r = scn.nextInt();
            int v = scn.nextInt();
            array[b - 1][f -1][r -1] += v;
        }


        for(int i = 0; i < 4; i++){
            for(int j = 0; j < 3; j++){
                for(int k = 0; k < 10; k++){
                    System.out.printf(" %d",array[i][j][k]);
                }
                System.out.printf("\n");
            }
            if(i != 3) System.out.printf("####################\n");
        }

    }
} Main public static void main(String[] args) {

        Scanner scn = new Scanner(System.in);
        int count = scn.nextInt();

        int[][][] array;
        array = new int[4][3][10];

        for(int i = 0; i < count; i++){
            int b = scn.nextInt();
            int f = scn.nextInt();
            int r = scn.nextInt();
            int v = scn.nextInt();
            array[b - 1][f -1][r -1] += v;
        }


        for(int i = 0; i < 4; i++){
            for(int j = 0; j < 3; j++){
                for(int k = 0; k < 10; k++){
                    System.out.printf(" %d",array[i][j][k]);
                }
                System.out.printf("\n");
            }
            if(i != 3) System.out.printf("####################\n");
        }

    } main {

        Scanner scn = new Scanner(System.in);
        int count = scn.nextInt();

        int[][][] array;
        array = new int[4][3][10];

        for(int i = 0; i < count; i++){
            int b = scn.nextInt();
            int f = scn.nextInt();
            int r = scn.nextInt();
            int v = scn.nextInt();
            array[b - 1][f -1][r -1] += v;
        }


        for(int i = 0; i < 4; i++){
            for(int j = 0; j < 3; j++){
                for(int k = 0; k < 10; k++){
                    System.out.printf(" %d",array[i][j][k]);
                }
                System.out.printf("\n");
            }
            if(i != 3) System.out.printf("####################\n");
        }

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

        Scanner scn = new Scanner(System.in);
        int count = scn.nextInt();

        int[][][] array;
        array = new int[4][3][10];

        for(int i = 0; i < count; i++){
            int b = scn.nextInt();
            int f = scn.nextInt();
            int r = scn.nextInt();
            int v = scn.nextInt();
            array[b - 1][f -1][r -1] += v;
        }


        for(int i = 0; i < 4; i++){
            for(int j = 0; j < 3; j++){
                for(int k = 0; k < 10; k++){
                    System.out.printf(" %d",array[i][j][k]);
                }
                System.out.printf("\n");
            }
            if(i != 3) System.out.printf("####################\n");
        }

    }
} public class Main {
    public static void main(String[] args) {

        Scanner scn = new Scanner(System.in);
        int count = scn.nextInt();

        int[][][] array;
        array = new int[4][3][10];

        for(int i = 0; i < count; i++){
            int b = scn.nextInt();
            int f = scn.nextInt();
            int r = scn.nextInt();
            int v = scn.nextInt();
            array[b - 1][f -1][r -1] += v;
        }


        for(int i = 0; i < 4; i++){
            for(int j = 0; j < 3; j++){
                for(int k = 0; k < 10; k++){
                    System.out.printf(" %d",array[i][j][k]);
                }
                System.out.printf("\n");
            }
            if(i != 3) System.out.printf("####################\n");
        }

    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {

        Scanner scn = new Scanner(System.in);
        int count = scn.nextInt();

        int[][][] array;
        array = new int[4][3][10];

        for(int i = 0; i < count; i++){
            int b = scn.nextInt();
            int f = scn.nextInt();
            int r = scn.nextInt();
            int v = scn.nextInt();
            array[b - 1][f -1][r -1] += v;
        }


        for(int i = 0; i < 4; i++){
            for(int j = 0; j < 3; j++){
                for(int k = 0; k < 10; k++){
                    System.out.printf(" %d",array[i][j][k]);
                }
                System.out.printf("\n");
            }
            if(i != 3) System.out.printf("####################\n");
        }

    }
}
