import java.util.*;
import java.text.*;

class Main {
    public static void main(String[]args)throws Exception {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int [][][] cnt = new int[4][3][10];
        while(n-- > 0) {
            int b = sc.nextInt() - 1;
            int f = sc.nextInt() - 1;
            int r = sc.nextInt() - 1;
            int v = sc.nextInt();
            cnt[b][f][r] += v;
        }
        for(int b = 0; b < 4; b++) {
            if(b>0)System.out.println("####################");
            for(int f = 0; f < 3; f++) {
                for(int r = 0; r < 10; r++) {
                    System.out.print(" " + cnt[b][f][r]);
                }
                System.out.println();
            }
        }
    }
} import java.util.*; util.* java import java.text.*; text.* java class Main {
    public static void main(String[]args)throws Exception {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int [][][] cnt = new int[4][3][10];
        while(n-- > 0) {
            int b = sc.nextInt() - 1;
            int f = sc.nextInt() - 1;
            int r = sc.nextInt() - 1;
            int v = sc.nextInt();
            cnt[b][f][r] += v;
        }
        for(int b = 0; b < 4; b++) {
            if(b>0)System.out.println("####################");
            for(int f = 0; f < 3; f++) {
                for(int r = 0; r < 10; r++) {
                    System.out.print(" " + cnt[b][f][r]);
                }
                System.out.println();
            }
        }
    }
} Main public static void main(String[]args)throws Exception {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int [][][] cnt = new int[4][3][10];
        while(n-- > 0) {
            int b = sc.nextInt() - 1;
            int f = sc.nextInt() - 1;
            int r = sc.nextInt() - 1;
            int v = sc.nextInt();
            cnt[b][f][r] += v;
        }
        for(int b = 0; b < 4; b++) {
            if(b>0)System.out.println("####################");
            for(int f = 0; f < 3; f++) {
                for(int r = 0; r < 10; r++) {
                    System.out.print(" " + cnt[b][f][r]);
                }
                System.out.println();
            }
        }
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int [][][] cnt = new int[4][3][10];
        while(n-- > 0) {
            int b = sc.nextInt() - 1;
            int f = sc.nextInt() - 1;
            int r = sc.nextInt() - 1;
            int v = sc.nextInt();
            cnt[b][f][r] += v;
        }
        for(int b = 0; b < 4; b++) {
            if(b>0)System.out.println("####################");
            for(int f = 0; f < 3; f++) {
                for(int r = 0; r < 10; r++) {
                    System.out.print(" " + cnt[b][f][r]);
                }
                System.out.println();
            }
        }
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int [][][] cnt = new int[4][3][10]; cnt new int[4][3][10] 4 3 10 while(n-- > 0) {
            int b = sc.nextInt() - 1;
            int f = sc.nextInt() - 1;
            int r = sc.nextInt() - 1;
            int v = sc.nextInt();
            cnt[b][f][r] += v;
        } n-- > 0 n-- n 0 {
            int b = sc.nextInt() - 1;
            int f = sc.nextInt() - 1;
            int r = sc.nextInt() - 1;
            int v = sc.nextInt();
            cnt[b][f][r] += v;
        } int b = sc.nextInt() - 1; b sc.nextInt() - 1 sc.nextInt() sc.nextInt sc 1 int f = sc.nextInt() - 1; f sc.nextInt() - 1 sc.nextInt() sc.nextInt sc 1 int r = sc.nextInt() - 1; r sc.nextInt() - 1 sc.nextInt() sc.nextInt sc 1 int v = sc.nextInt(); v sc.nextInt() sc.nextInt sc cnt[b][f][r] += v cnt[b][f][r] cnt[b][f] cnt[b] cnt b f r v for(int b = 0; b < 4; b++) {
            if(b>0)System.out.println("####################");
            for(int f = 0; f < 3; f++) {
                for(int r = 0; r < 10; r++) {
                    System.out.print(" " + cnt[b][f][r]);
                }
                System.out.println();
            }
        } int b = 0; int b = 0; b 0 b < 4 b 4 b++ b++ b {
            if(b>0)System.out.println("####################");
            for(int f = 0; f < 3; f++) {
                for(int r = 0; r < 10; r++) {
                    System.out.print(" " + cnt[b][f][r]);
                }
                System.out.println();
            }
        } {
            if(b>0)System.out.println("####################");
            for(int f = 0; f < 3; f++) {
                for(int r = 0; r < 10; r++) {
                    System.out.print(" " + cnt[b][f][r]);
                }
                System.out.println();
            }
        } if(b>0)System.out.println("####################"); b>0 b 0 System.out.println("####################") System.out.println System.out System System.out "####################" for(int f = 0; f < 3; f++) {
                for(int r = 0; r < 10; r++) {
                    System.out.print(" " + cnt[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(" " + cnt[b][f][r]);
                }
                System.out.println();
            } {
                for(int r = 0; r < 10; r++) {
                    System.out.print(" " + cnt[b][f][r]);
                }
                System.out.println();
            } for(int r = 0; r < 10; r++) {
                    System.out.print(" " + cnt[b][f][r]);
                } int r = 0; int r = 0; r 0 r < 10 r 10 r++ r++ r {
                    System.out.print(" " + cnt[b][f][r]);
                } {
                    System.out.print(" " + cnt[b][f][r]);
                } System.out.print(" " + cnt[b][f][r]) System.out.print System.out System System.out " " + cnt[b][f][r] " " cnt[b][f][r] cnt[b][f] cnt[b] cnt b f r System.out.println() System.out.println System.out System System.out String[]args args
import java.util.*;
import java.text.*;

class Main {
    public static void main(String[]args)throws Exception {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int [][][] cnt = new int[4][3][10];
        while(n-- > 0) {
            int b = sc.nextInt() - 1;
            int f = sc.nextInt() - 1;
            int r = sc.nextInt() - 1;
            int v = sc.nextInt();
            cnt[b][f][r] += v;
        }
        for(int b = 0; b < 4; b++) {
            if(b>0)System.out.println("####################");
            for(int f = 0; f < 3; f++) {
                for(int r = 0; r < 10; r++) {
                    System.out.print(" " + cnt[b][f][r]);
                }
                System.out.println();
            }
        }
    }
}