import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;

public class Main {
    public static void main(String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        
        String line = br.readLine();
        int num = Integer.parseInt(line);
        int[][][] numAry = 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++) {
                    numAry[i][j][k] = 0;
                }
            }
        }
        
        //input?????£??\
        for (int i = 0; i < num; i ++) {
            String[] aryInput = br.readLine().split(" ");
            
            int a = Integer.parseInt(aryInput[0]);
            int b = Integer.parseInt(aryInput[1]);
            int c = Integer.parseInt(aryInput[2]);
            
            numAry[a - 1][b - 1][c - 1] += Integer.parseInt(aryInput[3]);
        }
        
        //??????
        for(int i = 0; i < 4; i++){
            for (int j = 0; j < 3; j++) {
                for (int k = 0; k < 10; k++) {
                    System.out.print(" ");
                    System.out.print(numAry[i][j][k]);
                }
                System.out.println();
            }
            if(i != 3){
                System.out.println("####################");
            }
        }
    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.ArrayList; ArrayList java.util public class Main {
    public static void main(String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        
        String line = br.readLine();
        int num = Integer.parseInt(line);
        int[][][] numAry = 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++) {
                    numAry[i][j][k] = 0;
                }
            }
        }
        
        //input?????£??\
        for (int i = 0; i < num; i ++) {
            String[] aryInput = br.readLine().split(" ");
            
            int a = Integer.parseInt(aryInput[0]);
            int b = Integer.parseInt(aryInput[1]);
            int c = Integer.parseInt(aryInput[2]);
            
            numAry[a - 1][b - 1][c - 1] += Integer.parseInt(aryInput[3]);
        }
        
        //??????
        for(int i = 0; i < 4; i++){
            for (int j = 0; j < 3; j++) {
                for (int k = 0; k < 10; k++) {
                    System.out.print(" ");
                    System.out.print(numAry[i][j][k]);
                }
                System.out.println();
            }
            if(i != 3){
                System.out.println("####################");
            }
        }
    }
} Main public static void main(String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        
        String line = br.readLine();
        int num = Integer.parseInt(line);
        int[][][] numAry = 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++) {
                    numAry[i][j][k] = 0;
                }
            }
        }
        
        //input?????£??\
        for (int i = 0; i < num; i ++) {
            String[] aryInput = br.readLine().split(" ");
            
            int a = Integer.parseInt(aryInput[0]);
            int b = Integer.parseInt(aryInput[1]);
            int c = Integer.parseInt(aryInput[2]);
            
            numAry[a - 1][b - 1][c - 1] += Integer.parseInt(aryInput[3]);
        }
        
        //??????
        for(int i = 0; i < 4; i++){
            for (int j = 0; j < 3; j++) {
                for (int k = 0; k < 10; k++) {
                    System.out.print(" ");
                    System.out.print(numAry[i][j][k]);
                }
                System.out.println();
            }
            if(i != 3){
                System.out.println("####################");
            }
        }
    } main {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        
        String line = br.readLine();
        int num = Integer.parseInt(line);
        int[][][] numAry = 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++) {
                    numAry[i][j][k] = 0;
                }
            }
        }
        
        //input?????£??\
        for (int i = 0; i < num; i ++) {
            String[] aryInput = br.readLine().split(" ");
            
            int a = Integer.parseInt(aryInput[0]);
            int b = Integer.parseInt(aryInput[1]);
            int c = Integer.parseInt(aryInput[2]);
            
            numAry[a - 1][b - 1][c - 1] += Integer.parseInt(aryInput[3]);
        }
        
        //??????
        for(int i = 0; i < 4; i++){
            for (int j = 0; j < 3; j++) {
                for (int k = 0; k < 10; k++) {
                    System.out.print(" ");
                    System.out.print(numAry[i][j][k]);
                }
                System.out.println();
            }
            if(i != 3){
                System.out.println("####################");
            }
        }
    } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String line = br.readLine(); line br.readLine() br.readLine br int num = Integer.parseInt(line); num Integer.parseInt(line) Integer.parseInt Integer line int[][][] numAry = new int[4][3][10]; numAry 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++) {
                    numAry[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++) {
                    numAry[i][j][k] = 0;
                }
            }
        } {
            for (int j = 0; j < 3; j++) {
                for (int k = 0; k < 10; k++) {
                    numAry[i][j][k] = 0;
                }
            }
        } for (int j = 0; j < 3; j++) {
                for (int k = 0; k < 10; k++) {
                    numAry[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++) {
                    numAry[i][j][k] = 0;
                }
            } {
                for (int k = 0; k < 10; k++) {
                    numAry[i][j][k] = 0;
                }
            } for (int k = 0; k < 10; k++) {
                    numAry[i][j][k] = 0;
                } int k = 0; int k = 0; k 0 k < 10 k 10 k++ k++ k {
                    numAry[i][j][k] = 0;
                } {
                    numAry[i][j][k] = 0;
                } numAry[i][j][k] = 0 numAry[i][j][k] numAry[i][j] numAry[i] numAry i j k 0 for (int i = 0; i < num; i ++) {
            String[] aryInput = br.readLine().split(" ");
            
            int a = Integer.parseInt(aryInput[0]);
            int b = Integer.parseInt(aryInput[1]);
            int c = Integer.parseInt(aryInput[2]);
            
            numAry[a - 1][b - 1][c - 1] += Integer.parseInt(aryInput[3]);
        } int i = 0; int i = 0; i 0 i < num i num i ++ i ++ i {
            String[] aryInput = br.readLine().split(" ");
            
            int a = Integer.parseInt(aryInput[0]);
            int b = Integer.parseInt(aryInput[1]);
            int c = Integer.parseInt(aryInput[2]);
            
            numAry[a - 1][b - 1][c - 1] += Integer.parseInt(aryInput[3]);
        } {
            String[] aryInput = br.readLine().split(" ");
            
            int a = Integer.parseInt(aryInput[0]);
            int b = Integer.parseInt(aryInput[1]);
            int c = Integer.parseInt(aryInput[2]);
            
            numAry[a - 1][b - 1][c - 1] += Integer.parseInt(aryInput[3]);
        } String[] aryInput = br.readLine().split(" "); aryInput br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " int a = Integer.parseInt(aryInput[0]); a Integer.parseInt(aryInput[0]) Integer.parseInt Integer aryInput[0] aryInput 0 int b = Integer.parseInt(aryInput[1]); b Integer.parseInt(aryInput[1]) Integer.parseInt Integer aryInput[1] aryInput 1 int c = Integer.parseInt(aryInput[2]); c Integer.parseInt(aryInput[2]) Integer.parseInt Integer aryInput[2] aryInput 2 numAry[a - 1][b - 1][c - 1] += Integer.parseInt(aryInput[3]) numAry[a - 1][b - 1][c - 1] numAry[a - 1][b - 1] numAry[a - 1] numAry a - 1 a 1 b - 1 b 1 c - 1 c 1 Integer.parseInt(aryInput[3]) Integer.parseInt Integer aryInput[3] aryInput 3 for(int i = 0; i < 4; i++){
            for (int j = 0; j < 3; j++) {
                for (int k = 0; k < 10; k++) {
                    System.out.print(" ");
                    System.out.print(numAry[i][j][k]);
                }
                System.out.println();
            }
            if(i != 3){
                System.out.println("####################");
            }
        } 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.print(" ");
                    System.out.print(numAry[i][j][k]);
                }
                System.out.println();
            }
            if(i != 3){
                System.out.println("####################");
            }
        } {
            for (int j = 0; j < 3; j++) {
                for (int k = 0; k < 10; k++) {
                    System.out.print(" ");
                    System.out.print(numAry[i][j][k]);
                }
                System.out.println();
            }
            if(i != 3){
                System.out.println("####################");
            }
        } for (int j = 0; j < 3; j++) {
                for (int k = 0; k < 10; k++) {
                    System.out.print(" ");
                    System.out.print(numAry[i][j][k]);
                }
                System.out.println();
            } int j = 0; int j = 0; j 0 j < 3 j 3 j++ j++ j {
                for (int k = 0; k < 10; k++) {
                    System.out.print(" ");
                    System.out.print(numAry[i][j][k]);
                }
                System.out.println();
            } {
                for (int k = 0; k < 10; k++) {
                    System.out.print(" ");
                    System.out.print(numAry[i][j][k]);
                }
                System.out.println();
            } for (int k = 0; k < 10; k++) {
                    System.out.print(" ");
                    System.out.print(numAry[i][j][k]);
                } int k = 0; int k = 0; k 0 k < 10 k 10 k++ k++ k {
                    System.out.print(" ");
                    System.out.print(numAry[i][j][k]);
                } {
                    System.out.print(" ");
                    System.out.print(numAry[i][j][k]);
                } System.out.print(" ") System.out.print System.out System System.out " " System.out.print(numAry[i][j][k]) System.out.print System.out System System.out numAry[i][j][k] numAry[i][j] numAry[i] numAry i j k System.out.println() System.out.println System.out System System.out if(i != 3){
                System.out.println("####################");
            } i != 3 i 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) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        
        String line = br.readLine();
        int num = Integer.parseInt(line);
        int[][][] numAry = 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++) {
                    numAry[i][j][k] = 0;
                }
            }
        }
        
        //input?????£??\
        for (int i = 0; i < num; i ++) {
            String[] aryInput = br.readLine().split(" ");
            
            int a = Integer.parseInt(aryInput[0]);
            int b = Integer.parseInt(aryInput[1]);
            int c = Integer.parseInt(aryInput[2]);
            
            numAry[a - 1][b - 1][c - 1] += Integer.parseInt(aryInput[3]);
        }
        
        //??????
        for(int i = 0; i < 4; i++){
            for (int j = 0; j < 3; j++) {
                for (int k = 0; k < 10; k++) {
                    System.out.print(" ");
                    System.out.print(numAry[i][j][k]);
                }
                System.out.println();
            }
            if(i != 3){
                System.out.println("####################");
            }
        }
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        
        String line = br.readLine();
        int num = Integer.parseInt(line);
        int[][][] numAry = 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++) {
                    numAry[i][j][k] = 0;
                }
            }
        }
        
        //input?????£??\
        for (int i = 0; i < num; i ++) {
            String[] aryInput = br.readLine().split(" ");
            
            int a = Integer.parseInt(aryInput[0]);
            int b = Integer.parseInt(aryInput[1]);
            int c = Integer.parseInt(aryInput[2]);
            
            numAry[a - 1][b - 1][c - 1] += Integer.parseInt(aryInput[3]);
        }
        
        //??????
        for(int i = 0; i < 4; i++){
            for (int j = 0; j < 3; j++) {
                for (int k = 0; k < 10; k++) {
                    System.out.print(" ");
                    System.out.print(numAry[i][j][k]);
                }
                System.out.println();
            }
            if(i != 3){
                System.out.println("####################");
            }
        }
    }
} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;

public class Main {
    public static void main(String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        
        String line = br.readLine();
        int num = Integer.parseInt(line);
        int[][][] numAry = 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++) {
                    numAry[i][j][k] = 0;
                }
            }
        }
        
        //input?????£??\
        for (int i = 0; i < num; i ++) {
            String[] aryInput = br.readLine().split(" ");
            
            int a = Integer.parseInt(aryInput[0]);
            int b = Integer.parseInt(aryInput[1]);
            int c = Integer.parseInt(aryInput[2]);
            
            numAry[a - 1][b - 1][c - 1] += Integer.parseInt(aryInput[3]);
        }
        
        //??????
        for(int i = 0; i < 4; i++){
            for (int j = 0; j < 3; j++) {
                for (int k = 0; k < 10; k++) {
                    System.out.print(" ");
                    System.out.print(numAry[i][j][k]);
                }
                System.out.println();
            }
            if(i != 3){
                System.out.println("####################");
            }
        }
    }
}