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

public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String input = br.readLine();
        int n = Integer.parseInt(input);

        int[][][] count = new int[4][3][10];
        for (int i = 0; i < 4; i++) {
            for (int j = 0; j < 3; j++) {
                for (int k = 0; k < 10; k++) {
                    count[i][j][k] = 0;
                }
            }
        }
        //?????°?????????
        for (int i = 0; i < n; i++) {
            String str = br.readLine();
            String[] strs = str.split(" ");
            int b = Integer.parseInt(strs[0]) - 1;  //????£?
            int f = Integer.parseInt(strs[1]) - 1;  //???
            int r = Integer.parseInt(strs[2]) - 1;  //?????????
            int v = Integer.parseInt(strs[3]);
            count[b][f][r] += v;
        }
            for (int i = 0; i < 4; i++) {
                if(i != 0){
                    System.out.println("####################");
}
                    for(int l = 0; l < 3; l++){
                        for(int k = 0; k < 10; k++){
                            System.out.print(" ");
                            System.out.print(count[i][l][k]);
                        }//for
                        System.out.println();
                    }//for
            }
        
    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException 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));
        String input = br.readLine();
        int n = Integer.parseInt(input);

        int[][][] count = new int[4][3][10];
        for (int i = 0; i < 4; i++) {
            for (int j = 0; j < 3; j++) {
                for (int k = 0; k < 10; k++) {
                    count[i][j][k] = 0;
                }
            }
        }
        //?????°?????????
        for (int i = 0; i < n; i++) {
            String str = br.readLine();
            String[] strs = str.split(" ");
            int b = Integer.parseInt(strs[0]) - 1;  //????£?
            int f = Integer.parseInt(strs[1]) - 1;  //???
            int r = Integer.parseInt(strs[2]) - 1;  //?????????
            int v = Integer.parseInt(strs[3]);
            count[b][f][r] += v;
        }
            for (int i = 0; i < 4; i++) {
                if(i != 0){
                    System.out.println("####################");
}
                    for(int l = 0; l < 3; l++){
                        for(int k = 0; k < 10; k++){
                            System.out.print(" ");
                            System.out.print(count[i][l][k]);
                        }//for
                        System.out.println();
                    }//for
            }
        
    }
} Main public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String input = br.readLine();
        int n = Integer.parseInt(input);

        int[][][] count = new int[4][3][10];
        for (int i = 0; i < 4; i++) {
            for (int j = 0; j < 3; j++) {
                for (int k = 0; k < 10; k++) {
                    count[i][j][k] = 0;
                }
            }
        }
        //?????°?????????
        for (int i = 0; i < n; i++) {
            String str = br.readLine();
            String[] strs = str.split(" ");
            int b = Integer.parseInt(strs[0]) - 1;  //????£?
            int f = Integer.parseInt(strs[1]) - 1;  //???
            int r = Integer.parseInt(strs[2]) - 1;  //?????????
            int v = Integer.parseInt(strs[3]);
            count[b][f][r] += v;
        }
            for (int i = 0; i < 4; i++) {
                if(i != 0){
                    System.out.println("####################");
}
                    for(int l = 0; l < 3; l++){
                        for(int k = 0; k < 10; k++){
                            System.out.print(" ");
                            System.out.print(count[i][l][k]);
                        }//for
                        System.out.println();
                    }//for
            }
        
    } main {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String input = br.readLine();
        int n = Integer.parseInt(input);

        int[][][] count = new int[4][3][10];
        for (int i = 0; i < 4; i++) {
            for (int j = 0; j < 3; j++) {
                for (int k = 0; k < 10; k++) {
                    count[i][j][k] = 0;
                }
            }
        }
        //?????°?????????
        for (int i = 0; i < n; i++) {
            String str = br.readLine();
            String[] strs = str.split(" ");
            int b = Integer.parseInt(strs[0]) - 1;  //????£?
            int f = Integer.parseInt(strs[1]) - 1;  //???
            int r = Integer.parseInt(strs[2]) - 1;  //?????????
            int v = Integer.parseInt(strs[3]);
            count[b][f][r] += v;
        }
            for (int i = 0; i < 4; i++) {
                if(i != 0){
                    System.out.println("####################");
}
                    for(int l = 0; l < 3; l++){
                        for(int k = 0; k < 10; k++){
                            System.out.print(" ");
                            System.out.print(count[i][l][k]);
                        }//for
                        System.out.println();
                    }//for
            }
        
    } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String input = br.readLine(); input br.readLine() br.readLine br int n = Integer.parseInt(input); n Integer.parseInt(input) Integer.parseInt Integer input int[][][] count = new int[4][3][10]; count new int[4][3][10] 4 3 10 for (int i = 0; i < 4; i++) {
            for (int j = 0; j < 3; j++) {
                for (int k = 0; k < 10; k++) {
                    count[i][j][k] = 0;
                }
            }
        } 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++) {
                    count[i][j][k] = 0;
                }
            }
        } {
            for (int j = 0; j < 3; j++) {
                for (int k = 0; k < 10; k++) {
                    count[i][j][k] = 0;
                }
            }
        } for (int j = 0; j < 3; j++) {
                for (int k = 0; k < 10; k++) {
                    count[i][j][k] = 0;
                }
            } int j = 0; int j = 0; j 0 j < 3 j 3 j++ j++ j {
                for (int k = 0; k < 10; k++) {
                    count[i][j][k] = 0;
                }
            } {
                for (int k = 0; k < 10; k++) {
                    count[i][j][k] = 0;
                }
            } for (int k = 0; k < 10; k++) {
                    count[i][j][k] = 0;
                } int k = 0; int k = 0; k 0 k < 10 k 10 k++ k++ k {
                    count[i][j][k] = 0;
                } {
                    count[i][j][k] = 0;
                } count[i][j][k] = 0 count[i][j][k] count[i][j] count[i] count i j k 0 for (int i = 0; i < n; i++) {
            String str = br.readLine();
            String[] strs = str.split(" ");
            int b = Integer.parseInt(strs[0]) - 1;  //????£?
            int f = Integer.parseInt(strs[1]) - 1;  //???
            int r = Integer.parseInt(strs[2]) - 1;  //?????????
            int v = Integer.parseInt(strs[3]);
            count[b][f][r] += v;
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            String str = br.readLine();
            String[] strs = str.split(" ");
            int b = Integer.parseInt(strs[0]) - 1;  //????£?
            int f = Integer.parseInt(strs[1]) - 1;  //???
            int r = Integer.parseInt(strs[2]) - 1;  //?????????
            int v = Integer.parseInt(strs[3]);
            count[b][f][r] += v;
        } {
            String str = br.readLine();
            String[] strs = str.split(" ");
            int b = Integer.parseInt(strs[0]) - 1;  //????£?
            int f = Integer.parseInt(strs[1]) - 1;  //???
            int r = Integer.parseInt(strs[2]) - 1;  //?????????
            int v = Integer.parseInt(strs[3]);
            count[b][f][r] += v;
        } String str = br.readLine(); str br.readLine() br.readLine br String[] strs = str.split(" "); strs str.split(" ") str.split str " " int b = Integer.parseInt(strs[0]) - 1; b Integer.parseInt(strs[0]) - 1 Integer.parseInt(strs[0]) Integer.parseInt Integer strs[0] strs 0 1 int f = Integer.parseInt(strs[1]) - 1; f Integer.parseInt(strs[1]) - 1 Integer.parseInt(strs[1]) Integer.parseInt Integer strs[1] strs 1 1 int r = Integer.parseInt(strs[2]) - 1; r Integer.parseInt(strs[2]) - 1 Integer.parseInt(strs[2]) Integer.parseInt Integer strs[2] strs 2 1 int v = Integer.parseInt(strs[3]); v Integer.parseInt(strs[3]) Integer.parseInt Integer strs[3] strs 3 count[b][f][r] += v count[b][f][r] count[b][f] count[b] count b f r v for (int i = 0; i < 4; i++) {
                if(i != 0){
                    System.out.println("####################");
}
                    for(int l = 0; l < 3; l++){
                        for(int k = 0; k < 10; k++){
                            System.out.print(" ");
                            System.out.print(count[i][l][k]);
                        }//for
                        System.out.println();
                    }//for
            } int i = 0; int i = 0; i 0 i < 4 i 4 i++ i++ i {
                if(i != 0){
                    System.out.println("####################");
}
                    for(int l = 0; l < 3; l++){
                        for(int k = 0; k < 10; k++){
                            System.out.print(" ");
                            System.out.print(count[i][l][k]);
                        }//for
                        System.out.println();
                    }//for
            } {
                if(i != 0){
                    System.out.println("####################");
}
                    for(int l = 0; l < 3; l++){
                        for(int k = 0; k < 10; k++){
                            System.out.print(" ");
                            System.out.print(count[i][l][k]);
                        }//for
                        System.out.println();
                    }//for
            } if(i != 0){
                    System.out.println("####################");
} i != 0 i 0 {
                    System.out.println("####################");
} System.out.println("####################") System.out.println System.out System System.out "####################" for(int l = 0; l < 3; l++){
                        for(int k = 0; k < 10; k++){
                            System.out.print(" ");
                            System.out.print(count[i][l][k]);
                        }//for
                        System.out.println();
                    }//for int l = 0; int l = 0; l 0 l < 3 l 3 l++ l++ l {
                        for(int k = 0; k < 10; k++){
                            System.out.print(" ");
                            System.out.print(count[i][l][k]);
                        }//for
                        System.out.println();
                    }//for {
                        for(int k = 0; k < 10; k++){
                            System.out.print(" ");
                            System.out.print(count[i][l][k]);
                        }//for
                        System.out.println();
                    } for(int k = 0; k < 10; k++){
                            System.out.print(" ");
                            System.out.print(count[i][l][k]);
                        }//for int k = 0; int k = 0; k 0 k < 10 k 10 k++ k++ k {
                            System.out.print(" ");
                            System.out.print(count[i][l][k]);
                        }//for {
                            System.out.print(" ");
                            System.out.print(count[i][l][k]);
                        } System.out.print(" ") System.out.print System.out System System.out " " System.out.print(count[i][l][k]) System.out.print System.out System System.out count[i][l][k] count[i][l] count[i] count i l k System.out.println() System.out.println System.out System System.out String[] args args public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String input = br.readLine();
        int n = Integer.parseInt(input);

        int[][][] count = new int[4][3][10];
        for (int i = 0; i < 4; i++) {
            for (int j = 0; j < 3; j++) {
                for (int k = 0; k < 10; k++) {
                    count[i][j][k] = 0;
                }
            }
        }
        //?????°?????????
        for (int i = 0; i < n; i++) {
            String str = br.readLine();
            String[] strs = str.split(" ");
            int b = Integer.parseInt(strs[0]) - 1;  //????£?
            int f = Integer.parseInt(strs[1]) - 1;  //???
            int r = Integer.parseInt(strs[2]) - 1;  //?????????
            int v = Integer.parseInt(strs[3]);
            count[b][f][r] += v;
        }
            for (int i = 0; i < 4; i++) {
                if(i != 0){
                    System.out.println("####################");
}
                    for(int l = 0; l < 3; l++){
                        for(int k = 0; k < 10; k++){
                            System.out.print(" ");
                            System.out.print(count[i][l][k]);
                        }//for
                        System.out.println();
                    }//for
            }
        
    }
} public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String input = br.readLine();
        int n = Integer.parseInt(input);

        int[][][] count = new int[4][3][10];
        for (int i = 0; i < 4; i++) {
            for (int j = 0; j < 3; j++) {
                for (int k = 0; k < 10; k++) {
                    count[i][j][k] = 0;
                }
            }
        }
        //?????°?????????
        for (int i = 0; i < n; i++) {
            String str = br.readLine();
            String[] strs = str.split(" ");
            int b = Integer.parseInt(strs[0]) - 1;  //????£?
            int f = Integer.parseInt(strs[1]) - 1;  //???
            int r = Integer.parseInt(strs[2]) - 1;  //?????????
            int v = Integer.parseInt(strs[3]);
            count[b][f][r] += v;
        }
            for (int i = 0; i < 4; i++) {
                if(i != 0){
                    System.out.println("####################");
}
                    for(int l = 0; l < 3; l++){
                        for(int k = 0; k < 10; k++){
                            System.out.print(" ");
                            System.out.print(count[i][l][k]);
                        }//for
                        System.out.println();
                    }//for
            }
        
    }
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String input = br.readLine();
        int n = Integer.parseInt(input);

        int[][][] count = new int[4][3][10];
        for (int i = 0; i < 4; i++) {
            for (int j = 0; j < 3; j++) {
                for (int k = 0; k < 10; k++) {
                    count[i][j][k] = 0;
                }
            }
        }
        //?????°?????????
        for (int i = 0; i < n; i++) {
            String str = br.readLine();
            String[] strs = str.split(" ");
            int b = Integer.parseInt(strs[0]) - 1;  //????£?
            int f = Integer.parseInt(strs[1]) - 1;  //???
            int r = Integer.parseInt(strs[2]) - 1;  //?????????
            int v = Integer.parseInt(strs[3]);
            count[b][f][r] += v;
        }
            for (int i = 0; i < 4; i++) {
                if(i != 0){
                    System.out.println("####################");
}
                    for(int l = 0; l < 3; l++){
                        for(int k = 0; k < 10; k++){
                            System.out.print(" ");
                            System.out.print(count[i][l][k]);
                        }//for
                        System.out.println();
                    }//for
            }
        
    }
}