import java.util.Scanner;

public class Main {
    public static Scanner sc = new Scanner(System.in);
    public static void main(String[] args) throws Exception {
        int[][][] ary = new int[4][3][10];
        
        int n = sc.nextInt();
        for (int i = 0; i < n; i++) {
            int b = sc.nextInt()-1;
            int f = sc.nextInt()-1;
            int r = sc.nextInt()-1;
            int v = sc.nextInt();
            ary[b][f][r] += v;
        }
        
        for (int i = 0; i < 4; i++) {
            for (int j = 0; j < 3; j++) {
                StringBuilder sb = new StringBuilder();
                for (int k = 0; k < 10; k++) {
                    sb.append(" ").append(ary[i][j][k]);
                }
                System.out.println(sb.toString());
            }
            if (i != 3) System.out.println("####################");
        }
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static Scanner sc = new Scanner(System.in);
    public static void main(String[] args) throws Exception {
        int[][][] ary = new int[4][3][10];
        
        int n = sc.nextInt();
        for (int i = 0; i < n; i++) {
            int b = sc.nextInt()-1;
            int f = sc.nextInt()-1;
            int r = sc.nextInt()-1;
            int v = sc.nextInt();
            ary[b][f][r] += v;
        }
        
        for (int i = 0; i < 4; i++) {
            for (int j = 0; j < 3; j++) {
                StringBuilder sb = new StringBuilder();
                for (int k = 0; k < 10; k++) {
                    sb.append(" ").append(ary[i][j][k]);
                }
                System.out.println(sb.toString());
            }
            if (i != 3) System.out.println("####################");
        }
    }
} Main public static Scanner sc = new Scanner(System.in); sc new Scanner(System.in) public static void main(String[] args) throws Exception {
        int[][][] ary = new int[4][3][10];
        
        int n = sc.nextInt();
        for (int i = 0; i < n; i++) {
            int b = sc.nextInt()-1;
            int f = sc.nextInt()-1;
            int r = sc.nextInt()-1;
            int v = sc.nextInt();
            ary[b][f][r] += v;
        }
        
        for (int i = 0; i < 4; i++) {
            for (int j = 0; j < 3; j++) {
                StringBuilder sb = new StringBuilder();
                for (int k = 0; k < 10; k++) {
                    sb.append(" ").append(ary[i][j][k]);
                }
                System.out.println(sb.toString());
            }
            if (i != 3) System.out.println("####################");
        }
    } main {
        int[][][] ary = new int[4][3][10];
        
        int n = sc.nextInt();
        for (int i = 0; i < n; i++) {
            int b = sc.nextInt()-1;
            int f = sc.nextInt()-1;
            int r = sc.nextInt()-1;
            int v = sc.nextInt();
            ary[b][f][r] += v;
        }
        
        for (int i = 0; i < 4; i++) {
            for (int j = 0; j < 3; j++) {
                StringBuilder sb = new StringBuilder();
                for (int k = 0; k < 10; k++) {
                    sb.append(" ").append(ary[i][j][k]);
                }
                System.out.println(sb.toString());
            }
            if (i != 3) System.out.println("####################");
        }
    } int[][][] ary = new int[4][3][10]; ary 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 f = sc.nextInt()-1;
            int r = sc.nextInt()-1;
            int v = sc.nextInt();
            ary[b][f][r] += v;
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            int b = sc.nextInt()-1;
            int f = sc.nextInt()-1;
            int r = sc.nextInt()-1;
            int v = sc.nextInt();
            ary[b][f][r] += v;
        } {
            int b = sc.nextInt()-1;
            int f = sc.nextInt()-1;
            int r = sc.nextInt()-1;
            int v = sc.nextInt();
            ary[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 ary[b][f][r] += v ary[b][f][r] ary[b][f] ary[b] ary b f r v for (int i = 0; i < 4; i++) {
            for (int j = 0; j < 3; j++) {
                StringBuilder sb = new StringBuilder();
                for (int k = 0; k < 10; k++) {
                    sb.append(" ").append(ary[i][j][k]);
                }
                System.out.println(sb.toString());
            }
            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++) {
                StringBuilder sb = new StringBuilder();
                for (int k = 0; k < 10; k++) {
                    sb.append(" ").append(ary[i][j][k]);
                }
                System.out.println(sb.toString());
            }
            if (i != 3) System.out.println("####################");
        } {
            for (int j = 0; j < 3; j++) {
                StringBuilder sb = new StringBuilder();
                for (int k = 0; k < 10; k++) {
                    sb.append(" ").append(ary[i][j][k]);
                }
                System.out.println(sb.toString());
            }
            if (i != 3) System.out.println("####################");
        } for (int j = 0; j < 3; j++) {
                StringBuilder sb = new StringBuilder();
                for (int k = 0; k < 10; k++) {
                    sb.append(" ").append(ary[i][j][k]);
                }
                System.out.println(sb.toString());
            } int j = 0; int j = 0; j 0 j < 3 j 3 j++ j++ j {
                StringBuilder sb = new StringBuilder();
                for (int k = 0; k < 10; k++) {
                    sb.append(" ").append(ary[i][j][k]);
                }
                System.out.println(sb.toString());
            } {
                StringBuilder sb = new StringBuilder();
                for (int k = 0; k < 10; k++) {
                    sb.append(" ").append(ary[i][j][k]);
                }
                System.out.println(sb.toString());
            } StringBuilder sb = new StringBuilder(); sb new StringBuilder() for (int k = 0; k < 10; k++) {
                    sb.append(" ").append(ary[i][j][k]);
                } int k = 0; int k = 0; k 0 k < 10 k 10 k++ k++ k {
                    sb.append(" ").append(ary[i][j][k]);
                } {
                    sb.append(" ").append(ary[i][j][k]);
                } sb.append(" ").append(ary[i][j][k]) sb.append(" ").append sb.append(" ") sb.append sb " " ary[i][j][k] ary[i][j] ary[i] ary i j k System.out.println(sb.toString()) System.out.println System.out System System.out sb.toString() sb.toString sb if (i != 3) System.out.println("####################"); i != 3 i 3 System.out.println("####################") System.out.println System.out System System.out "####################" String[] args args public class Main {
    public static Scanner sc = new Scanner(System.in);
    public static void main(String[] args) throws Exception {
        int[][][] ary = new int[4][3][10];
        
        int n = sc.nextInt();
        for (int i = 0; i < n; i++) {
            int b = sc.nextInt()-1;
            int f = sc.nextInt()-1;
            int r = sc.nextInt()-1;
            int v = sc.nextInt();
            ary[b][f][r] += v;
        }
        
        for (int i = 0; i < 4; i++) {
            for (int j = 0; j < 3; j++) {
                StringBuilder sb = new StringBuilder();
                for (int k = 0; k < 10; k++) {
                    sb.append(" ").append(ary[i][j][k]);
                }
                System.out.println(sb.toString());
            }
            if (i != 3) System.out.println("####################");
        }
    }
} public class Main {
    public static Scanner sc = new Scanner(System.in);
    public static void main(String[] args) throws Exception {
        int[][][] ary = new int[4][3][10];
        
        int n = sc.nextInt();
        for (int i = 0; i < n; i++) {
            int b = sc.nextInt()-1;
            int f = sc.nextInt()-1;
            int r = sc.nextInt()-1;
            int v = sc.nextInt();
            ary[b][f][r] += v;
        }
        
        for (int i = 0; i < 4; i++) {
            for (int j = 0; j < 3; j++) {
                StringBuilder sb = new StringBuilder();
                for (int k = 0; k < 10; k++) {
                    sb.append(" ").append(ary[i][j][k]);
                }
                System.out.println(sb.toString());
            }
            if (i != 3) System.out.println("####################");
        }
    }
} Main
import java.util.Scanner;

public class Main {
    public static Scanner sc = new Scanner(System.in);
    public static void main(String[] args) throws Exception {
        int[][][] ary = new int[4][3][10];
        
        int n = sc.nextInt();
        for (int i = 0; i < n; i++) {
            int b = sc.nextInt()-1;
            int f = sc.nextInt()-1;
            int r = sc.nextInt()-1;
            int v = sc.nextInt();
            ary[b][f][r] += v;
        }
        
        for (int i = 0; i < 4; i++) {
            for (int j = 0; j < 3; j++) {
                StringBuilder sb = new StringBuilder();
                for (int k = 0; k < 10; k++) {
                    sb.append(" ").append(ary[i][j][k]);
                }
                System.out.println(sb.toString());
            }
            if (i != 3) System.out.println("####################");
        }
    }
}