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

public class Main {

    public static void main(String args[]) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
        int[][] floor = new int[13][11];
        int n = Integer.parseInt(br.readLine());
        while (n-- > 0) {
            String[] st = br.readLine().split(" ");
            int block = Integer.parseInt(st[0]);
            int y = Integer.parseInt(st[1]);
            int x = Integer.parseInt(st[2]);
            int value = Integer.parseInt(st[3]);
            floor[(3 * (block - 1)) + y][x] += value;
        }

        for (int i = 1; i < 13; i++) {
            for (int j = 1; j < 11; j++) {
                bw.append(" " + floor[i][j]);
            }
            bw.newLine();
            if (i % 3 == 0 && i < 12) {
                bw.append("####################\n");
            }
        }

        bw.flush();
    }

}
 import java.io.BufferedReader; BufferedReader java.io import java.io.BufferedWriter; BufferedWriter java.io import java.io.InputStreamReader; InputStreamReader java.io import java.io.OutputStreamWriter; OutputStreamWriter java.io import java.io.IOException; IOException java.io public class Main {

    public static void main(String args[]) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
        int[][] floor = new int[13][11];
        int n = Integer.parseInt(br.readLine());
        while (n-- > 0) {
            String[] st = br.readLine().split(" ");
            int block = Integer.parseInt(st[0]);
            int y = Integer.parseInt(st[1]);
            int x = Integer.parseInt(st[2]);
            int value = Integer.parseInt(st[3]);
            floor[(3 * (block - 1)) + y][x] += value;
        }

        for (int i = 1; i < 13; i++) {
            for (int j = 1; j < 11; j++) {
                bw.append(" " + floor[i][j]);
            }
            bw.newLine();
            if (i % 3 == 0 && i < 12) {
                bw.append("####################\n");
            }
        }

        bw.flush();
    }

} Main public static void main(String args[]) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
        int[][] floor = new int[13][11];
        int n = Integer.parseInt(br.readLine());
        while (n-- > 0) {
            String[] st = br.readLine().split(" ");
            int block = Integer.parseInt(st[0]);
            int y = Integer.parseInt(st[1]);
            int x = Integer.parseInt(st[2]);
            int value = Integer.parseInt(st[3]);
            floor[(3 * (block - 1)) + y][x] += value;
        }

        for (int i = 1; i < 13; i++) {
            for (int j = 1; j < 11; j++) {
                bw.append(" " + floor[i][j]);
            }
            bw.newLine();
            if (i % 3 == 0 && i < 12) {
                bw.append("####################\n");
            }
        }

        bw.flush();
    } main {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
        int[][] floor = new int[13][11];
        int n = Integer.parseInt(br.readLine());
        while (n-- > 0) {
            String[] st = br.readLine().split(" ");
            int block = Integer.parseInt(st[0]);
            int y = Integer.parseInt(st[1]);
            int x = Integer.parseInt(st[2]);
            int value = Integer.parseInt(st[3]);
            floor[(3 * (block - 1)) + y][x] += value;
        }

        for (int i = 1; i < 13; i++) {
            for (int j = 1; j < 11; j++) {
                bw.append(" " + floor[i][j]);
            }
            bw.newLine();
            if (i % 3 == 0 && i < 12) {
                bw.append("####################\n");
            }
        }

        bw.flush();
    } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out)); bw new BufferedWriter(new OutputStreamWriter(System.out)) int[][] floor = new int[13][11]; floor new int[13][11] 13 11 int n = Integer.parseInt(br.readLine()); n Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br while (n-- > 0) {
            String[] st = br.readLine().split(" ");
            int block = Integer.parseInt(st[0]);
            int y = Integer.parseInt(st[1]);
            int x = Integer.parseInt(st[2]);
            int value = Integer.parseInt(st[3]);
            floor[(3 * (block - 1)) + y][x] += value;
        } n-- > 0 n-- n 0 {
            String[] st = br.readLine().split(" ");
            int block = Integer.parseInt(st[0]);
            int y = Integer.parseInt(st[1]);
            int x = Integer.parseInt(st[2]);
            int value = Integer.parseInt(st[3]);
            floor[(3 * (block - 1)) + y][x] += value;
        } String[] st = br.readLine().split(" "); st br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " int block = Integer.parseInt(st[0]); block Integer.parseInt(st[0]) Integer.parseInt Integer st[0] st 0 int y = Integer.parseInt(st[1]); y Integer.parseInt(st[1]) Integer.parseInt Integer st[1] st 1 int x = Integer.parseInt(st[2]); x Integer.parseInt(st[2]) Integer.parseInt Integer st[2] st 2 int value = Integer.parseInt(st[3]); value Integer.parseInt(st[3]) Integer.parseInt Integer st[3] st 3 floor[(3 * (block - 1)) + y][x] += value floor[(3 * (block - 1)) + y][x] floor[(3 * (block - 1)) + y] floor (3 * (block - 1)) + y (3 * (block - 1)) 3 (block - 1) block 1 y x value for (int i = 1; i < 13; i++) {
            for (int j = 1; j < 11; j++) {
                bw.append(" " + floor[i][j]);
            }
            bw.newLine();
            if (i % 3 == 0 && i < 12) {
                bw.append("####################\n");
            }
        } int i = 1; int i = 1; i 1 i < 13 i 13 i++ i++ i {
            for (int j = 1; j < 11; j++) {
                bw.append(" " + floor[i][j]);
            }
            bw.newLine();
            if (i % 3 == 0 && i < 12) {
                bw.append("####################\n");
            }
        } {
            for (int j = 1; j < 11; j++) {
                bw.append(" " + floor[i][j]);
            }
            bw.newLine();
            if (i % 3 == 0 && i < 12) {
                bw.append("####################\n");
            }
        } for (int j = 1; j < 11; j++) {
                bw.append(" " + floor[i][j]);
            } int j = 1; int j = 1; j 1 j < 11 j 11 j++ j++ j {
                bw.append(" " + floor[i][j]);
            } {
                bw.append(" " + floor[i][j]);
            } bw.append(" " + floor[i][j]) bw.append bw " " + floor[i][j] " " floor[i][j] floor[i] floor i j bw.newLine() bw.newLine bw if (i % 3 == 0 && i < 12) {
                bw.append("####################\n");
            } i % 3 == 0 && i < 12 i % 3 == 0 i % 3 i 3 0 i < 12 i 12 {
                bw.append("####################\n");
            } bw.append("####################\n") bw.append bw "####################\n" bw.flush() bw.flush bw String args[] args public class Main {

    public static void main(String args[]) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
        int[][] floor = new int[13][11];
        int n = Integer.parseInt(br.readLine());
        while (n-- > 0) {
            String[] st = br.readLine().split(" ");
            int block = Integer.parseInt(st[0]);
            int y = Integer.parseInt(st[1]);
            int x = Integer.parseInt(st[2]);
            int value = Integer.parseInt(st[3]);
            floor[(3 * (block - 1)) + y][x] += value;
        }

        for (int i = 1; i < 13; i++) {
            for (int j = 1; j < 11; j++) {
                bw.append(" " + floor[i][j]);
            }
            bw.newLine();
            if (i % 3 == 0 && i < 12) {
                bw.append("####################\n");
            }
        }

        bw.flush();
    }

} public class Main {

    public static void main(String args[]) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
        int[][] floor = new int[13][11];
        int n = Integer.parseInt(br.readLine());
        while (n-- > 0) {
            String[] st = br.readLine().split(" ");
            int block = Integer.parseInt(st[0]);
            int y = Integer.parseInt(st[1]);
            int x = Integer.parseInt(st[2]);
            int value = Integer.parseInt(st[3]);
            floor[(3 * (block - 1)) + y][x] += value;
        }

        for (int i = 1; i < 13; i++) {
            for (int j = 1; j < 11; j++) {
                bw.append(" " + floor[i][j]);
            }
            bw.newLine();
            if (i % 3 == 0 && i < 12) {
                bw.append("####################\n");
            }
        }

        bw.flush();
    }

} Main
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.IOException;

public class Main {

    public static void main(String args[]) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
        int[][] floor = new int[13][11];
        int n = Integer.parseInt(br.readLine());
        while (n-- > 0) {
            String[] st = br.readLine().split(" ");
            int block = Integer.parseInt(st[0]);
            int y = Integer.parseInt(st[1]);
            int x = Integer.parseInt(st[2]);
            int value = Integer.parseInt(st[3]);
            floor[(3 * (block - 1)) + y][x] += value;
        }

        for (int i = 1; i < 13; i++) {
            for (int j = 1; j < 11; j++) {
                bw.append(" " + floor[i][j]);
            }
            bw.newLine();
            if (i % 3 == 0 && i < 12) {
                bw.append("####################\n");
            }
        }

        bw.flush();
    }

}

