import java.io.IOException;
import java.util.Scanner;
public class Main {
    public static void main (String args[]) throws IOException {
        Scanner sc = new Scanner(System.in);
        StringBuffer sb = new StringBuffer();
        int[][][] r = new int[4][3][10];
        int n = sc.nextInt();
        for (int i = 0; i < n; i++) {
        	int b =sc.nextInt() - 1;
        	int c =sc.nextInt() - 1;
        	int d =sc.nextInt() - 1;
        	int e =sc.nextInt();
            r[b][c][d] += e;
        }
        for (int i = 0; i < 4; ++i) {
            if (i != 0) {
                System.out.println("####################");
            }
            for (int j = 0; j < 3; j++) {
                for (int k = 0; k < 10; k++) {
                    System.out.print(" " + r[i][j][k]);
                }
                System.out.println();
            }
        }
        }


    } import java.io.IOException; IOException java.io import java.util.Scanner; Scanner java.util public class Main {
    public static void main (String args[]) throws IOException {
        Scanner sc = new Scanner(System.in);
        StringBuffer sb = new StringBuffer();
        int[][][] r = new int[4][3][10];
        int n = sc.nextInt();
        for (int i = 0; i < n; i++) {
        	int b =sc.nextInt() - 1;
        	int c =sc.nextInt() - 1;
        	int d =sc.nextInt() - 1;
        	int e =sc.nextInt();
            r[b][c][d] += e;
        }
        for (int i = 0; i < 4; ++i) {
            if (i != 0) {
                System.out.println("####################");
            }
            for (int j = 0; j < 3; j++) {
                for (int k = 0; k < 10; k++) {
                    System.out.print(" " + r[i][j][k]);
                }
                System.out.println();
            }
        }
        }


    } Main public static void main (String args[]) throws IOException {
        Scanner sc = new Scanner(System.in);
        StringBuffer sb = new StringBuffer();
        int[][][] r = new int[4][3][10];
        int n = sc.nextInt();
        for (int i = 0; i < n; i++) {
        	int b =sc.nextInt() - 1;
        	int c =sc.nextInt() - 1;
        	int d =sc.nextInt() - 1;
        	int e =sc.nextInt();
            r[b][c][d] += e;
        }
        for (int i = 0; i < 4; ++i) {
            if (i != 0) {
                System.out.println("####################");
            }
            for (int j = 0; j < 3; j++) {
                for (int k = 0; k < 10; k++) {
                    System.out.print(" " + r[i][j][k]);
                }
                System.out.println();
            }
        }
        } main {
        Scanner sc = new Scanner(System.in);
        StringBuffer sb = new StringBuffer();
        int[][][] r = new int[4][3][10];
        int n = sc.nextInt();
        for (int i = 0; i < n; i++) {
        	int b =sc.nextInt() - 1;
        	int c =sc.nextInt() - 1;
        	int d =sc.nextInt() - 1;
        	int e =sc.nextInt();
            r[b][c][d] += e;
        }
        for (int i = 0; i < 4; ++i) {
            if (i != 0) {
                System.out.println("####################");
            }
            for (int j = 0; j < 3; j++) {
                for (int k = 0; k < 10; k++) {
                    System.out.print(" " + r[i][j][k]);
                }
                System.out.println();
            }
        }
        } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) StringBuffer sb = new StringBuffer(); sb new StringBuffer() int[][][] r = new int[4][3][10]; r new int[4][3][10] 4 3 10 int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc for (int i = 0; i < n; i++) {
        	int b =sc.nextInt() - 1;
        	int c =sc.nextInt() - 1;
        	int d =sc.nextInt() - 1;
        	int e =sc.nextInt();
            r[b][c][d] += e;
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
        	int b =sc.nextInt() - 1;
        	int c =sc.nextInt() - 1;
        	int d =sc.nextInt() - 1;
        	int e =sc.nextInt();
            r[b][c][d] += e;
        } {
        	int b =sc.nextInt() - 1;
        	int c =sc.nextInt() - 1;
        	int d =sc.nextInt() - 1;
        	int e =sc.nextInt();
            r[b][c][d] += e;
        } int b =sc.nextInt() - 1; b sc.nextInt() - 1 sc.nextInt() sc.nextInt sc 1 int c =sc.nextInt() - 1; c sc.nextInt() - 1 sc.nextInt() sc.nextInt sc 1 int d =sc.nextInt() - 1; d sc.nextInt() - 1 sc.nextInt() sc.nextInt sc 1 int e =sc.nextInt(); e sc.nextInt() sc.nextInt sc r[b][c][d] += e r[b][c][d] r[b][c] r[b] r b c d e for (int i = 0; i < 4; ++i) {
            if (i != 0) {
                System.out.println("####################");
            }
            for (int j = 0; j < 3; j++) {
                for (int k = 0; k < 10; k++) {
                    System.out.print(" " + r[i][j][k]);
                }
                System.out.println();
            }
        } int i = 0; int i = 0; i 0 i < 4 i 4 ++i ++i i {
            if (i != 0) {
                System.out.println("####################");
            }
            for (int j = 0; j < 3; j++) {
                for (int k = 0; k < 10; k++) {
                    System.out.print(" " + r[i][j][k]);
                }
                System.out.println();
            }
        } {
            if (i != 0) {
                System.out.println("####################");
            }
            for (int j = 0; j < 3; j++) {
                for (int k = 0; k < 10; k++) {
                    System.out.print(" " + r[i][j][k]);
                }
                System.out.println();
            }
        } 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 j = 0; j < 3; j++) {
                for (int k = 0; k < 10; k++) {
                    System.out.print(" " + r[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(" " + r[i][j][k]);
                }
                System.out.println();
            } {
                for (int k = 0; k < 10; k++) {
                    System.out.print(" " + r[i][j][k]);
                }
                System.out.println();
            } for (int k = 0; k < 10; k++) {
                    System.out.print(" " + r[i][j][k]);
                } int k = 0; int k = 0; k 0 k < 10 k 10 k++ k++ k {
                    System.out.print(" " + r[i][j][k]);
                } {
                    System.out.print(" " + r[i][j][k]);
                } System.out.print(" " + r[i][j][k]) System.out.print System.out System System.out " " + r[i][j][k] " " r[i][j][k] r[i][j] r[i] r i j 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 {
        Scanner sc = new Scanner(System.in);
        StringBuffer sb = new StringBuffer();
        int[][][] r = new int[4][3][10];
        int n = sc.nextInt();
        for (int i = 0; i < n; i++) {
        	int b =sc.nextInt() - 1;
        	int c =sc.nextInt() - 1;
        	int d =sc.nextInt() - 1;
        	int e =sc.nextInt();
            r[b][c][d] += e;
        }
        for (int i = 0; i < 4; ++i) {
            if (i != 0) {
                System.out.println("####################");
            }
            for (int j = 0; j < 3; j++) {
                for (int k = 0; k < 10; k++) {
                    System.out.print(" " + r[i][j][k]);
                }
                System.out.println();
            }
        }
        }


    } public class Main {
    public static void main (String args[]) throws IOException {
        Scanner sc = new Scanner(System.in);
        StringBuffer sb = new StringBuffer();
        int[][][] r = new int[4][3][10];
        int n = sc.nextInt();
        for (int i = 0; i < n; i++) {
        	int b =sc.nextInt() - 1;
        	int c =sc.nextInt() - 1;
        	int d =sc.nextInt() - 1;
        	int e =sc.nextInt();
            r[b][c][d] += e;
        }
        for (int i = 0; i < 4; ++i) {
            if (i != 0) {
                System.out.println("####################");
            }
            for (int j = 0; j < 3; j++) {
                for (int k = 0; k < 10; k++) {
                    System.out.print(" " + r[i][j][k]);
                }
                System.out.println();
            }
        }
        }


    } Main
import java.io.IOException;
import java.util.Scanner;
public class Main {
    public static void main (String args[]) throws IOException {
        Scanner sc = new Scanner(System.in);
        StringBuffer sb = new StringBuffer();
        int[][][] r = new int[4][3][10];
        int n = sc.nextInt();
        for (int i = 0; i < n; i++) {
        	int b =sc.nextInt() - 1;
        	int c =sc.nextInt() - 1;
        	int d =sc.nextInt() - 1;
        	int e =sc.nextInt();
            r[b][c][d] += e;
        }
        for (int i = 0; i < 4; ++i) {
            if (i != 0) {
                System.out.println("####################");
            }
            for (int j = 0; j < 3; j++) {
                for (int k = 0; k < 10; k++) {
                    System.out.print(" " + r[i][j][k]);
                }
                System.out.println();
            }
        }
        }


    }