import java.io.BufferedReader;
import java.io.InputStreamReader;
 
public class Main {
    public static void main(String[] args) throws Exception {
        int[][][] rooms = new int[4][3][10];
 
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        br.readLine();
        String line;
        while ((line = br.readLine()) != null) {
            String[] arr = line.split(" ");
            int b = Integer.parseInt(arr[0]) - 1;
            int f = Integer.parseInt(arr[1]) - 1;
            int r = Integer.parseInt(arr[2]) - 1;
            int v = Integer.parseInt(arr[3]);
 
            rooms[b][f][r] += v;
        }
 
        for (int b = 0; b < 4; b++) {
            for (int f = 0; f < 3; f++) {
                for (int r = 0; r < 10; r++) {
                    System.out.print(" " + rooms[b][f][r]);
                }
                System.out.println();
            }
            if (b != 3)
                System.out.println("####################");
        }
    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {
    public static void main(String[] args) throws Exception {
        int[][][] rooms = new int[4][3][10];
 
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        br.readLine();
        String line;
        while ((line = br.readLine()) != null) {
            String[] arr = line.split(" ");
            int b = Integer.parseInt(arr[0]) - 1;
            int f = Integer.parseInt(arr[1]) - 1;
            int r = Integer.parseInt(arr[2]) - 1;
            int v = Integer.parseInt(arr[3]);
 
            rooms[b][f][r] += v;
        }
 
        for (int b = 0; b < 4; b++) {
            for (int f = 0; f < 3; f++) {
                for (int r = 0; r < 10; r++) {
                    System.out.print(" " + rooms[b][f][r]);
                }
                System.out.println();
            }
            if (b != 3)
                System.out.println("####################");
        }
    }
} Main public static void main(String[] args) throws Exception {
        int[][][] rooms = new int[4][3][10];
 
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        br.readLine();
        String line;
        while ((line = br.readLine()) != null) {
            String[] arr = line.split(" ");
            int b = Integer.parseInt(arr[0]) - 1;
            int f = Integer.parseInt(arr[1]) - 1;
            int r = Integer.parseInt(arr[2]) - 1;
            int v = Integer.parseInt(arr[3]);
 
            rooms[b][f][r] += v;
        }
 
        for (int b = 0; b < 4; b++) {
            for (int f = 0; f < 3; f++) {
                for (int r = 0; r < 10; r++) {
                    System.out.print(" " + rooms[b][f][r]);
                }
                System.out.println();
            }
            if (b != 3)
                System.out.println("####################");
        }
    } main {
        int[][][] rooms = new int[4][3][10];
 
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        br.readLine();
        String line;
        while ((line = br.readLine()) != null) {
            String[] arr = line.split(" ");
            int b = Integer.parseInt(arr[0]) - 1;
            int f = Integer.parseInt(arr[1]) - 1;
            int r = Integer.parseInt(arr[2]) - 1;
            int v = Integer.parseInt(arr[3]);
 
            rooms[b][f][r] += v;
        }
 
        for (int b = 0; b < 4; b++) {
            for (int f = 0; f < 3; f++) {
                for (int r = 0; r < 10; r++) {
                    System.out.print(" " + rooms[b][f][r]);
                }
                System.out.println();
            }
            if (b != 3)
                System.out.println("####################");
        }
    } int[][][] rooms = new int[4][3][10]; rooms new int[4][3][10] 4 3 10 BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) br.readLine() br.readLine br String line; line while ((line = br.readLine()) != null) {
            String[] arr = line.split(" ");
            int b = Integer.parseInt(arr[0]) - 1;
            int f = Integer.parseInt(arr[1]) - 1;
            int r = Integer.parseInt(arr[2]) - 1;
            int v = Integer.parseInt(arr[3]);
 
            rooms[b][f][r] += v;
        } (line = br.readLine()) != null (line = br.readLine()) line br.readLine() br.readLine br null {
            String[] arr = line.split(" ");
            int b = Integer.parseInt(arr[0]) - 1;
            int f = Integer.parseInt(arr[1]) - 1;
            int r = Integer.parseInt(arr[2]) - 1;
            int v = Integer.parseInt(arr[3]);
 
            rooms[b][f][r] += v;
        } String[] arr = line.split(" "); arr line.split(" ") line.split line " " int b = Integer.parseInt(arr[0]) - 1; b Integer.parseInt(arr[0]) - 1 Integer.parseInt(arr[0]) Integer.parseInt Integer arr[0] arr 0 1 int f = Integer.parseInt(arr[1]) - 1; f Integer.parseInt(arr[1]) - 1 Integer.parseInt(arr[1]) Integer.parseInt Integer arr[1] arr 1 1 int r = Integer.parseInt(arr[2]) - 1; r Integer.parseInt(arr[2]) - 1 Integer.parseInt(arr[2]) Integer.parseInt Integer arr[2] arr 2 1 int v = Integer.parseInt(arr[3]); v Integer.parseInt(arr[3]) Integer.parseInt Integer arr[3] arr 3 rooms[b][f][r] += v rooms[b][f][r] rooms[b][f] rooms[b] rooms b f r v for (int b = 0; b < 4; b++) {
            for (int f = 0; f < 3; f++) {
                for (int r = 0; r < 10; r++) {
                    System.out.print(" " + rooms[b][f][r]);
                }
                System.out.println();
            }
            if (b != 3)
                System.out.println("####################");
        } 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++) {
                    System.out.print(" " + rooms[b][f][r]);
                }
                System.out.println();
            }
            if (b != 3)
                System.out.println("####################");
        } {
            for (int f = 0; f < 3; f++) {
                for (int r = 0; r < 10; r++) {
                    System.out.print(" " + rooms[b][f][r]);
                }
                System.out.println();
            }
            if (b != 3)
                System.out.println("####################");
        } for (int f = 0; f < 3; f++) {
                for (int r = 0; r < 10; r++) {
                    System.out.print(" " + rooms[b][f][r]);
                }
                System.out.println();
            } int f = 0; int f = 0; f 0 f < 3 f 3 f++ f++ f {
                for (int r = 0; r < 10; r++) {
                    System.out.print(" " + rooms[b][f][r]);
                }
                System.out.println();
            } {
                for (int r = 0; r < 10; r++) {
                    System.out.print(" " + rooms[b][f][r]);
                }
                System.out.println();
            } for (int r = 0; r < 10; r++) {
                    System.out.print(" " + rooms[b][f][r]);
                } int r = 0; int r = 0; r 0 r < 10 r 10 r++ r++ r {
                    System.out.print(" " + rooms[b][f][r]);
                } {
                    System.out.print(" " + rooms[b][f][r]);
                } System.out.print(" " + rooms[b][f][r]) System.out.print System.out System System.out " " + rooms[b][f][r] " " rooms[b][f][r] rooms[b][f] rooms[b] rooms b f r System.out.println() System.out.println System.out System System.out if (b != 3)
                System.out.println("####################"); b != 3 b 3 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 {
        int[][][] rooms = new int[4][3][10];
 
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        br.readLine();
        String line;
        while ((line = br.readLine()) != null) {
            String[] arr = line.split(" ");
            int b = Integer.parseInt(arr[0]) - 1;
            int f = Integer.parseInt(arr[1]) - 1;
            int r = Integer.parseInt(arr[2]) - 1;
            int v = Integer.parseInt(arr[3]);
 
            rooms[b][f][r] += v;
        }
 
        for (int b = 0; b < 4; b++) {
            for (int f = 0; f < 3; f++) {
                for (int r = 0; r < 10; r++) {
                    System.out.print(" " + rooms[b][f][r]);
                }
                System.out.println();
            }
            if (b != 3)
                System.out.println("####################");
        }
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        int[][][] rooms = new int[4][3][10];
 
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        br.readLine();
        String line;
        while ((line = br.readLine()) != null) {
            String[] arr = line.split(" ");
            int b = Integer.parseInt(arr[0]) - 1;
            int f = Integer.parseInt(arr[1]) - 1;
            int r = Integer.parseInt(arr[2]) - 1;
            int v = Integer.parseInt(arr[3]);
 
            rooms[b][f][r] += v;
        }
 
        for (int b = 0; b < 4; b++) {
            for (int f = 0; f < 3; f++) {
                for (int r = 0; r < 10; r++) {
                    System.out.print(" " + rooms[b][f][r]);
                }
                System.out.println();
            }
            if (b != 3)
                System.out.println("####################");
        }
    }
} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;
 
public class Main {
    public static void main(String[] args) throws Exception {
        int[][][] rooms = new int[4][3][10];
 
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        br.readLine();
        String line;
        while ((line = br.readLine()) != null) {
            String[] arr = line.split(" ");
            int b = Integer.parseInt(arr[0]) - 1;
            int f = Integer.parseInt(arr[1]) - 1;
            int r = Integer.parseInt(arr[2]) - 1;
            int v = Integer.parseInt(arr[3]);
 
            rooms[b][f][r] += v;
        }
 
        for (int b = 0; b < 4; b++) {
            for (int f = 0; f < 3; f++) {
                for (int r = 0; r < 10; r++) {
                    System.out.print(" " + rooms[b][f][r]);
                }
                System.out.println();
            }
            if (b != 3)
                System.out.println("####################");
        }
    }
}