import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main{
    public static void main(String[] args) throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int[][][] info = new int[4][3][10];
        
        int num = Integer.parseInt(br.readLine());
        
        //data input
        for(int i = 0; i < num; i++){
            String[] input = br.readLine().split(" ");
            int b = Integer.valueOf(input[0])-1;
            int f = Integer.valueOf(input[1])-1;
            int r = Integer.valueOf(input[2])-1;
            int v = Integer.valueOf(input[3]);
            info[b][f][r] += v;
        }

        //data output
        StringBuilder sb = new StringBuilder();
        for(int b = 0; b < 4; b++){
            for(int f = 0; f < 3; f++){
                for(int r = 0; r < 10; r++){
                    sb.append(" " + info[b][f][r]);
                }
                sb.append("\n");
            }
            if(b != 3)  sb.append("####################\n");
        }

        System.out.print(sb);
    }
} import java.io.IOException; IOException java.io import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main{
    public static void main(String[] args) throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int[][][] info = new int[4][3][10];
        
        int num = Integer.parseInt(br.readLine());
        
        //data input
        for(int i = 0; i < num; i++){
            String[] input = br.readLine().split(" ");
            int b = Integer.valueOf(input[0])-1;
            int f = Integer.valueOf(input[1])-1;
            int r = Integer.valueOf(input[2])-1;
            int v = Integer.valueOf(input[3]);
            info[b][f][r] += v;
        }

        //data output
        StringBuilder sb = new StringBuilder();
        for(int b = 0; b < 4; b++){
            for(int f = 0; f < 3; f++){
                for(int r = 0; r < 10; r++){
                    sb.append(" " + info[b][f][r]);
                }
                sb.append("\n");
            }
            if(b != 3)  sb.append("####################\n");
        }

        System.out.print(sb);
    }
} Main public static void main(String[] args) throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int[][][] info = new int[4][3][10];
        
        int num = Integer.parseInt(br.readLine());
        
        //data input
        for(int i = 0; i < num; i++){
            String[] input = br.readLine().split(" ");
            int b = Integer.valueOf(input[0])-1;
            int f = Integer.valueOf(input[1])-1;
            int r = Integer.valueOf(input[2])-1;
            int v = Integer.valueOf(input[3]);
            info[b][f][r] += v;
        }

        //data output
        StringBuilder sb = new StringBuilder();
        for(int b = 0; b < 4; b++){
            for(int f = 0; f < 3; f++){
                for(int r = 0; r < 10; r++){
                    sb.append(" " + info[b][f][r]);
                }
                sb.append("\n");
            }
            if(b != 3)  sb.append("####################\n");
        }

        System.out.print(sb);
    } main {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int[][][] info = new int[4][3][10];
        
        int num = Integer.parseInt(br.readLine());
        
        //data input
        for(int i = 0; i < num; i++){
            String[] input = br.readLine().split(" ");
            int b = Integer.valueOf(input[0])-1;
            int f = Integer.valueOf(input[1])-1;
            int r = Integer.valueOf(input[2])-1;
            int v = Integer.valueOf(input[3]);
            info[b][f][r] += v;
        }

        //data output
        StringBuilder sb = new StringBuilder();
        for(int b = 0; b < 4; b++){
            for(int f = 0; f < 3; f++){
                for(int r = 0; r < 10; r++){
                    sb.append(" " + info[b][f][r]);
                }
                sb.append("\n");
            }
            if(b != 3)  sb.append("####################\n");
        }

        System.out.print(sb);
    } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) int[][][] info = new int[4][3][10]; info new int[4][3][10] 4 3 10 int num = Integer.parseInt(br.readLine()); num Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br for(int i = 0; i < num; i++){
            String[] input = br.readLine().split(" ");
            int b = Integer.valueOf(input[0])-1;
            int f = Integer.valueOf(input[1])-1;
            int r = Integer.valueOf(input[2])-1;
            int v = Integer.valueOf(input[3]);
            info[b][f][r] += v;
        } int i = 0; int i = 0; i 0 i < num i num i++ i++ i {
            String[] input = br.readLine().split(" ");
            int b = Integer.valueOf(input[0])-1;
            int f = Integer.valueOf(input[1])-1;
            int r = Integer.valueOf(input[2])-1;
            int v = Integer.valueOf(input[3]);
            info[b][f][r] += v;
        } {
            String[] input = br.readLine().split(" ");
            int b = Integer.valueOf(input[0])-1;
            int f = Integer.valueOf(input[1])-1;
            int r = Integer.valueOf(input[2])-1;
            int v = Integer.valueOf(input[3]);
            info[b][f][r] += v;
        } String[] input = br.readLine().split(" "); input br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " int b = Integer.valueOf(input[0])-1; b Integer.valueOf(input[0])-1 Integer.valueOf(input[0]) Integer.valueOf Integer input[0] input 0 1 int f = Integer.valueOf(input[1])-1; f Integer.valueOf(input[1])-1 Integer.valueOf(input[1]) Integer.valueOf Integer input[1] input 1 1 int r = Integer.valueOf(input[2])-1; r Integer.valueOf(input[2])-1 Integer.valueOf(input[2]) Integer.valueOf Integer input[2] input 2 1 int v = Integer.valueOf(input[3]); v Integer.valueOf(input[3]) Integer.valueOf Integer input[3] input 3 info[b][f][r] += v info[b][f][r] info[b][f] info[b] info b f r v StringBuilder sb = new StringBuilder(); sb new StringBuilder() for(int b = 0; b < 4; b++){
            for(int f = 0; f < 3; f++){
                for(int r = 0; r < 10; r++){
                    sb.append(" " + info[b][f][r]);
                }
                sb.append("\n");
            }
            if(b != 3)  sb.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++){
                    sb.append(" " + info[b][f][r]);
                }
                sb.append("\n");
            }
            if(b != 3)  sb.append("####################\n");
        } {
            for(int f = 0; f < 3; f++){
                for(int r = 0; r < 10; r++){
                    sb.append(" " + info[b][f][r]);
                }
                sb.append("\n");
            }
            if(b != 3)  sb.append("####################\n");
        } for(int f = 0; f < 3; f++){
                for(int r = 0; r < 10; r++){
                    sb.append(" " + info[b][f][r]);
                }
                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++){
                    sb.append(" " + info[b][f][r]);
                }
                sb.append("\n");
            } {
                for(int r = 0; r < 10; r++){
                    sb.append(" " + info[b][f][r]);
                }
                sb.append("\n");
            } for(int r = 0; r < 10; r++){
                    sb.append(" " + info[b][f][r]);
                } int r = 0; int r = 0; r 0 r < 10 r 10 r++ r++ r {
                    sb.append(" " + info[b][f][r]);
                } {
                    sb.append(" " + info[b][f][r]);
                } sb.append(" " + info[b][f][r]) sb.append sb " " + info[b][f][r] " " info[b][f][r] info[b][f] info[b] info b f r sb.append("\n") sb.append sb "\n" if(b != 3)  sb.append("####################\n"); b != 3 b 3 sb.append("####################\n") 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));
        int[][][] info = new int[4][3][10];
        
        int num = Integer.parseInt(br.readLine());
        
        //data input
        for(int i = 0; i < num; i++){
            String[] input = br.readLine().split(" ");
            int b = Integer.valueOf(input[0])-1;
            int f = Integer.valueOf(input[1])-1;
            int r = Integer.valueOf(input[2])-1;
            int v = Integer.valueOf(input[3]);
            info[b][f][r] += v;
        }

        //data output
        StringBuilder sb = new StringBuilder();
        for(int b = 0; b < 4; b++){
            for(int f = 0; f < 3; f++){
                for(int r = 0; r < 10; r++){
                    sb.append(" " + info[b][f][r]);
                }
                sb.append("\n");
            }
            if(b != 3)  sb.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));
        int[][][] info = new int[4][3][10];
        
        int num = Integer.parseInt(br.readLine());
        
        //data input
        for(int i = 0; i < num; i++){
            String[] input = br.readLine().split(" ");
            int b = Integer.valueOf(input[0])-1;
            int f = Integer.valueOf(input[1])-1;
            int r = Integer.valueOf(input[2])-1;
            int v = Integer.valueOf(input[3]);
            info[b][f][r] += v;
        }

        //data output
        StringBuilder sb = new StringBuilder();
        for(int b = 0; b < 4; b++){
            for(int f = 0; f < 3; f++){
                for(int r = 0; r < 10; r++){
                    sb.append(" " + info[b][f][r]);
                }
                sb.append("\n");
            }
            if(b != 3)  sb.append("####################\n");
        }

        System.out.print(sb);
    }
} Main
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main{
    public static void main(String[] args) throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int[][][] info = new int[4][3][10];
        
        int num = Integer.parseInt(br.readLine());
        
        //data input
        for(int i = 0; i < num; i++){
            String[] input = br.readLine().split(" ");
            int b = Integer.valueOf(input[0])-1;
            int f = Integer.valueOf(input[1])-1;
            int r = Integer.valueOf(input[2])-1;
            int v = Integer.valueOf(input[3]);
            info[b][f][r] += v;
        }

        //data output
        StringBuilder sb = new StringBuilder();
        for(int b = 0; b < 4; b++){
            for(int f = 0; f < 3; f++){
                for(int r = 0; r < 10; r++){
                    sb.append(" " + info[b][f][r]);
                }
                sb.append("\n");
            }
            if(b != 3)  sb.append("####################\n");
        }

        System.out.print(sb);
    }
}