import java.io.*;

public class Main{
    public static void main(String[]args)throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringBuilder sb = new StringBuilder();
        int[][][] floor = new int[4][3][10];

        int count = Integer.parseInt(br.readLine());
        int[] num = new int[4];
        for(int i=0; i<count; i++){
            String[] str = br.readLine().split(" ");
            for(int k=0; k<4; k++){
                num[k] = Integer.parseInt(str[k]);
            }
            floor[num[0] -1][num[1] -1][num[2] -1] += num[3];
        }

        for(int b=0; b<4; b++){
            for(int f=0; f<3; f++){
                for(int r=0; r<10; r++){
                    if(r == 0)sb.append(" ");
                    sb.append(floor[b][f][r]);
                    if(r != 9)sb.append(" ");
                }
                sb.append("\n");
            }
            if(b<3){
                sb.append("####################").append("\n");
            }
        }
        System.out.print(sb);

    }
} import java.io.*; io.* java public class Main{
    public static void main(String[]args)throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringBuilder sb = new StringBuilder();
        int[][][] floor = new int[4][3][10];

        int count = Integer.parseInt(br.readLine());
        int[] num = new int[4];
        for(int i=0; i<count; i++){
            String[] str = br.readLine().split(" ");
            for(int k=0; k<4; k++){
                num[k] = Integer.parseInt(str[k]);
            }
            floor[num[0] -1][num[1] -1][num[2] -1] += num[3];
        }

        for(int b=0; b<4; b++){
            for(int f=0; f<3; f++){
                for(int r=0; r<10; r++){
                    if(r == 0)sb.append(" ");
                    sb.append(floor[b][f][r]);
                    if(r != 9)sb.append(" ");
                }
                sb.append("\n");
            }
            if(b<3){
                sb.append("####################").append("\n");
            }
        }
        System.out.print(sb);

    }
} Main public static void main(String[]args)throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringBuilder sb = new StringBuilder();
        int[][][] floor = new int[4][3][10];

        int count = Integer.parseInt(br.readLine());
        int[] num = new int[4];
        for(int i=0; i<count; i++){
            String[] str = br.readLine().split(" ");
            for(int k=0; k<4; k++){
                num[k] = Integer.parseInt(str[k]);
            }
            floor[num[0] -1][num[1] -1][num[2] -1] += num[3];
        }

        for(int b=0; b<4; b++){
            for(int f=0; f<3; f++){
                for(int r=0; r<10; r++){
                    if(r == 0)sb.append(" ");
                    sb.append(floor[b][f][r]);
                    if(r != 9)sb.append(" ");
                }
                sb.append("\n");
            }
            if(b<3){
                sb.append("####################").append("\n");
            }
        }
        System.out.print(sb);

    } main {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringBuilder sb = new StringBuilder();
        int[][][] floor = new int[4][3][10];

        int count = Integer.parseInt(br.readLine());
        int[] num = new int[4];
        for(int i=0; i<count; i++){
            String[] str = br.readLine().split(" ");
            for(int k=0; k<4; k++){
                num[k] = Integer.parseInt(str[k]);
            }
            floor[num[0] -1][num[1] -1][num[2] -1] += num[3];
        }

        for(int b=0; b<4; b++){
            for(int f=0; f<3; f++){
                for(int r=0; r<10; r++){
                    if(r == 0)sb.append(" ");
                    sb.append(floor[b][f][r]);
                    if(r != 9)sb.append(" ");
                }
                sb.append("\n");
            }
            if(b<3){
                sb.append("####################").append("\n");
            }
        }
        System.out.print(sb);

    } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) StringBuilder sb = new StringBuilder(); sb new StringBuilder() int[][][] floor = new int[4][3][10]; floor new int[4][3][10] 4 3 10 int count = Integer.parseInt(br.readLine()); count Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br int[] num = new int[4]; num new int[4] 4 for(int i=0; i<count; i++){
            String[] str = br.readLine().split(" ");
            for(int k=0; k<4; k++){
                num[k] = Integer.parseInt(str[k]);
            }
            floor[num[0] -1][num[1] -1][num[2] -1] += num[3];
        } int i=0; int i=0; i 0 i<count i count i++ i++ i {
            String[] str = br.readLine().split(" ");
            for(int k=0; k<4; k++){
                num[k] = Integer.parseInt(str[k]);
            }
            floor[num[0] -1][num[1] -1][num[2] -1] += num[3];
        } {
            String[] str = br.readLine().split(" ");
            for(int k=0; k<4; k++){
                num[k] = Integer.parseInt(str[k]);
            }
            floor[num[0] -1][num[1] -1][num[2] -1] += num[3];
        } String[] str = br.readLine().split(" "); str br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " for(int k=0; k<4; k++){
                num[k] = Integer.parseInt(str[k]);
            } int k=0; int k=0; k 0 k<4 k 4 k++ k++ k {
                num[k] = Integer.parseInt(str[k]);
            } {
                num[k] = Integer.parseInt(str[k]);
            } num[k] = Integer.parseInt(str[k]) num[k] num k Integer.parseInt(str[k]) Integer.parseInt Integer str[k] str k floor[num[0] -1][num[1] -1][num[2] -1] += num[3] floor[num[0] -1][num[1] -1][num[2] -1] floor[num[0] -1][num[1] -1] floor[num[0] -1] floor num[0] -1 num[0] num 0 1 num[1] -1 num[1] num 1 1 num[2] -1 num[2] num 2 1 num[3] num 3 for(int b=0; b<4; b++){
            for(int f=0; f<3; f++){
                for(int r=0; r<10; r++){
                    if(r == 0)sb.append(" ");
                    sb.append(floor[b][f][r]);
                    if(r != 9)sb.append(" ");
                }
                sb.append("\n");
            }
            if(b<3){
                sb.append("####################").append("\n");
            }
        } 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++){
                    if(r == 0)sb.append(" ");
                    sb.append(floor[b][f][r]);
                    if(r != 9)sb.append(" ");
                }
                sb.append("\n");
            }
            if(b<3){
                sb.append("####################").append("\n");
            }
        } {
            for(int f=0; f<3; f++){
                for(int r=0; r<10; r++){
                    if(r == 0)sb.append(" ");
                    sb.append(floor[b][f][r]);
                    if(r != 9)sb.append(" ");
                }
                sb.append("\n");
            }
            if(b<3){
                sb.append("####################").append("\n");
            }
        } for(int f=0; f<3; f++){
                for(int r=0; r<10; r++){
                    if(r == 0)sb.append(" ");
                    sb.append(floor[b][f][r]);
                    if(r != 9)sb.append(" ");
                }
                sb.append("\n");
            } int f=0; int f=0; f 0 f<3 f 3 f++ f++ f {
                for(int r=0; r<10; r++){
                    if(r == 0)sb.append(" ");
                    sb.append(floor[b][f][r]);
                    if(r != 9)sb.append(" ");
                }
                sb.append("\n");
            } {
                for(int r=0; r<10; r++){
                    if(r == 0)sb.append(" ");
                    sb.append(floor[b][f][r]);
                    if(r != 9)sb.append(" ");
                }
                sb.append("\n");
            } for(int r=0; r<10; r++){
                    if(r == 0)sb.append(" ");
                    sb.append(floor[b][f][r]);
                    if(r != 9)sb.append(" ");
                } int r=0; int r=0; r 0 r<10 r 10 r++ r++ r {
                    if(r == 0)sb.append(" ");
                    sb.append(floor[b][f][r]);
                    if(r != 9)sb.append(" ");
                } {
                    if(r == 0)sb.append(" ");
                    sb.append(floor[b][f][r]);
                    if(r != 9)sb.append(" ");
                } if(r == 0)sb.append(" "); r == 0 r 0 sb.append(" ") sb.append sb " " sb.append(floor[b][f][r]) sb.append sb floor[b][f][r] floor[b][f] floor[b] floor b f r if(r != 9)sb.append(" "); r != 9 r 9 sb.append(" ") sb.append sb " " sb.append("\n") sb.append sb "\n" if(b<3){
                sb.append("####################").append("\n");
            } b<3 b 3 {
                sb.append("####################").append("\n");
            } sb.append("####################").append("\n") sb.append("####################").append sb.append("####################") sb.append sb "####################" "\n" System.out.print(sb) System.out.print System.out System System.out sb String[]args args public class Main{
    public static void main(String[]args)throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringBuilder sb = new StringBuilder();
        int[][][] floor = new int[4][3][10];

        int count = Integer.parseInt(br.readLine());
        int[] num = new int[4];
        for(int i=0; i<count; i++){
            String[] str = br.readLine().split(" ");
            for(int k=0; k<4; k++){
                num[k] = Integer.parseInt(str[k]);
            }
            floor[num[0] -1][num[1] -1][num[2] -1] += num[3];
        }

        for(int b=0; b<4; b++){
            for(int f=0; f<3; f++){
                for(int r=0; r<10; r++){
                    if(r == 0)sb.append(" ");
                    sb.append(floor[b][f][r]);
                    if(r != 9)sb.append(" ");
                }
                sb.append("\n");
            }
            if(b<3){
                sb.append("####################").append("\n");
            }
        }
        System.out.print(sb);

    }
} public class Main{
    public static void main(String[]args)throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringBuilder sb = new StringBuilder();
        int[][][] floor = new int[4][3][10];

        int count = Integer.parseInt(br.readLine());
        int[] num = new int[4];
        for(int i=0; i<count; i++){
            String[] str = br.readLine().split(" ");
            for(int k=0; k<4; k++){
                num[k] = Integer.parseInt(str[k]);
            }
            floor[num[0] -1][num[1] -1][num[2] -1] += num[3];
        }

        for(int b=0; b<4; b++){
            for(int f=0; f<3; f++){
                for(int r=0; r<10; r++){
                    if(r == 0)sb.append(" ");
                    sb.append(floor[b][f][r]);
                    if(r != 9)sb.append(" ");
                }
                sb.append("\n");
            }
            if(b<3){
                sb.append("####################").append("\n");
            }
        }
        System.out.print(sb);

    }
} Main
import java.io.*;

public class Main{
    public static void main(String[]args)throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringBuilder sb = new StringBuilder();
        int[][][] floor = new int[4][3][10];

        int count = Integer.parseInt(br.readLine());
        int[] num = new int[4];
        for(int i=0; i<count; i++){
            String[] str = br.readLine().split(" ");
            for(int k=0; k<4; k++){
                num[k] = Integer.parseInt(str[k]);
            }
            floor[num[0] -1][num[1] -1][num[2] -1] += num[3];
        }

        for(int b=0; b<4; b++){
            for(int f=0; f<3; f++){
                for(int r=0; r<10; r++){
                    if(r == 0)sb.append(" ");
                    sb.append(floor[b][f][r]);
                    if(r != 9)sb.append(" ");
                }
                sb.append("\n");
            }
            if(b<3){
                sb.append("####################").append("\n");
            }
        }
        System.out.print(sb);

    }
}