import java.util.Scanner;


public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[][] tow1 = new int[3][10];
        int[][] tow2 = new int[3][10];
        int[][] tow3 = new int[3][10];
        int[][] tow4 = new int[3][10];
        int b = 0, f = 0, r = 0, v = 0;
        int num = sc.nextInt();

        for (int i = 0; i < num; i++) {
            b = sc.nextInt();
            f = sc.nextInt()-1;
            r = sc.nextInt()-1;
            v = sc.nextInt();
            if (b == 1) {
                tow1[f][r] += v;
            } else if (b == 2) {
                tow2[f][r] += v;
            } else if (b == 3) {
                tow3[f][r] += v;
            } else if (b == 4) {
                tow4[f][r] += v;
            }
            
    }
        for (int i = 0; i <= 2; i++) {
            for (int j = 0; j < 10; j++) {
                System.out.printf(" %d", tow1[i][j]);
            }
            System.out.println();
        }
        System.out.println("####################");
        for (int i = 0; i <= 2; i++) {
            for (int j = 0; j < 10; j++) {
                System.out.printf(" %d", tow2[i][j]);
            }
            System.out.println();
        }
        System.out.println("####################");
        for (int i = 0; i <= 2; i++) {
            for (int j = 0; j < 10; j++) {
                System.out.printf(" %d", tow3[i][j]);
            }
            System.out.println();
        }
        System.out.println("####################");
        for (int i = 0; i <= 2; i++) {
            for (int j = 0; j < 10; j++) {
                System.out.printf(" %d", tow4[i][j]);
            }
            System.out.println();
        }

        sc.close();
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[][] tow1 = new int[3][10];
        int[][] tow2 = new int[3][10];
        int[][] tow3 = new int[3][10];
        int[][] tow4 = new int[3][10];
        int b = 0, f = 0, r = 0, v = 0;
        int num = sc.nextInt();

        for (int i = 0; i < num; i++) {
            b = sc.nextInt();
            f = sc.nextInt()-1;
            r = sc.nextInt()-1;
            v = sc.nextInt();
            if (b == 1) {
                tow1[f][r] += v;
            } else if (b == 2) {
                tow2[f][r] += v;
            } else if (b == 3) {
                tow3[f][r] += v;
            } else if (b == 4) {
                tow4[f][r] += v;
            }
            
    }
        for (int i = 0; i <= 2; i++) {
            for (int j = 0; j < 10; j++) {
                System.out.printf(" %d", tow1[i][j]);
            }
            System.out.println();
        }
        System.out.println("####################");
        for (int i = 0; i <= 2; i++) {
            for (int j = 0; j < 10; j++) {
                System.out.printf(" %d", tow2[i][j]);
            }
            System.out.println();
        }
        System.out.println("####################");
        for (int i = 0; i <= 2; i++) {
            for (int j = 0; j < 10; j++) {
                System.out.printf(" %d", tow3[i][j]);
            }
            System.out.println();
        }
        System.out.println("####################");
        for (int i = 0; i <= 2; i++) {
            for (int j = 0; j < 10; j++) {
                System.out.printf(" %d", tow4[i][j]);
            }
            System.out.println();
        }

        sc.close();
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[][] tow1 = new int[3][10];
        int[][] tow2 = new int[3][10];
        int[][] tow3 = new int[3][10];
        int[][] tow4 = new int[3][10];
        int b = 0, f = 0, r = 0, v = 0;
        int num = sc.nextInt();

        for (int i = 0; i < num; i++) {
            b = sc.nextInt();
            f = sc.nextInt()-1;
            r = sc.nextInt()-1;
            v = sc.nextInt();
            if (b == 1) {
                tow1[f][r] += v;
            } else if (b == 2) {
                tow2[f][r] += v;
            } else if (b == 3) {
                tow3[f][r] += v;
            } else if (b == 4) {
                tow4[f][r] += v;
            }
            
    }
        for (int i = 0; i <= 2; i++) {
            for (int j = 0; j < 10; j++) {
                System.out.printf(" %d", tow1[i][j]);
            }
            System.out.println();
        }
        System.out.println("####################");
        for (int i = 0; i <= 2; i++) {
            for (int j = 0; j < 10; j++) {
                System.out.printf(" %d", tow2[i][j]);
            }
            System.out.println();
        }
        System.out.println("####################");
        for (int i = 0; i <= 2; i++) {
            for (int j = 0; j < 10; j++) {
                System.out.printf(" %d", tow3[i][j]);
            }
            System.out.println();
        }
        System.out.println("####################");
        for (int i = 0; i <= 2; i++) {
            for (int j = 0; j < 10; j++) {
                System.out.printf(" %d", tow4[i][j]);
            }
            System.out.println();
        }

        sc.close();
    } main {
        Scanner sc = new Scanner(System.in);
        int[][] tow1 = new int[3][10];
        int[][] tow2 = new int[3][10];
        int[][] tow3 = new int[3][10];
        int[][] tow4 = new int[3][10];
        int b = 0, f = 0, r = 0, v = 0;
        int num = sc.nextInt();

        for (int i = 0; i < num; i++) {
            b = sc.nextInt();
            f = sc.nextInt()-1;
            r = sc.nextInt()-1;
            v = sc.nextInt();
            if (b == 1) {
                tow1[f][r] += v;
            } else if (b == 2) {
                tow2[f][r] += v;
            } else if (b == 3) {
                tow3[f][r] += v;
            } else if (b == 4) {
                tow4[f][r] += v;
            }
            
    }
        for (int i = 0; i <= 2; i++) {
            for (int j = 0; j < 10; j++) {
                System.out.printf(" %d", tow1[i][j]);
            }
            System.out.println();
        }
        System.out.println("####################");
        for (int i = 0; i <= 2; i++) {
            for (int j = 0; j < 10; j++) {
                System.out.printf(" %d", tow2[i][j]);
            }
            System.out.println();
        }
        System.out.println("####################");
        for (int i = 0; i <= 2; i++) {
            for (int j = 0; j < 10; j++) {
                System.out.printf(" %d", tow3[i][j]);
            }
            System.out.println();
        }
        System.out.println("####################");
        for (int i = 0; i <= 2; i++) {
            for (int j = 0; j < 10; j++) {
                System.out.printf(" %d", tow4[i][j]);
            }
            System.out.println();
        }

        sc.close();
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int[][] tow1 = new int[3][10]; tow1 new int[3][10] 3 10 int[][] tow2 = new int[3][10]; tow2 new int[3][10] 3 10 int[][] tow3 = new int[3][10]; tow3 new int[3][10] 3 10 int[][] tow4 = new int[3][10]; tow4 new int[3][10] 3 10 int b = 0 b 0 f = 0 f 0 r = 0 r 0 v = 0; v 0 int num = sc.nextInt(); num sc.nextInt() sc.nextInt sc for (int i = 0; i < num; i++) {
            b = sc.nextInt();
            f = sc.nextInt()-1;
            r = sc.nextInt()-1;
            v = sc.nextInt();
            if (b == 1) {
                tow1[f][r] += v;
            } else if (b == 2) {
                tow2[f][r] += v;
            } else if (b == 3) {
                tow3[f][r] += v;
            } else if (b == 4) {
                tow4[f][r] += v;
            }
            
    } int i = 0; int i = 0; i 0 i < num i num i++ i++ i {
            b = sc.nextInt();
            f = sc.nextInt()-1;
            r = sc.nextInt()-1;
            v = sc.nextInt();
            if (b == 1) {
                tow1[f][r] += v;
            } else if (b == 2) {
                tow2[f][r] += v;
            } else if (b == 3) {
                tow3[f][r] += v;
            } else if (b == 4) {
                tow4[f][r] += v;
            }
            
    } {
            b = sc.nextInt();
            f = sc.nextInt()-1;
            r = sc.nextInt()-1;
            v = sc.nextInt();
            if (b == 1) {
                tow1[f][r] += v;
            } else if (b == 2) {
                tow2[f][r] += v;
            } else if (b == 3) {
                tow3[f][r] += v;
            } else if (b == 4) {
                tow4[f][r] += v;
            }
            
    } b = sc.nextInt() b sc.nextInt() sc.nextInt sc f = sc.nextInt()-1 f sc.nextInt()-1 sc.nextInt() sc.nextInt sc 1 r = sc.nextInt()-1 r sc.nextInt()-1 sc.nextInt() sc.nextInt sc 1 v = sc.nextInt() v sc.nextInt() sc.nextInt sc if (b == 1) {
                tow1[f][r] += v;
            } else if (b == 2) {
                tow2[f][r] += v;
            } else if (b == 3) {
                tow3[f][r] += v;
            } else if (b == 4) {
                tow4[f][r] += v;
            } b == 1 b 1 {
                tow1[f][r] += v;
            } tow1[f][r] += v tow1[f][r] tow1[f] tow1 f r v if (b == 2) {
                tow2[f][r] += v;
            } else if (b == 3) {
                tow3[f][r] += v;
            } else if (b == 4) {
                tow4[f][r] += v;
            } b == 2 b 2 {
                tow2[f][r] += v;
            } tow2[f][r] += v tow2[f][r] tow2[f] tow2 f r v if (b == 3) {
                tow3[f][r] += v;
            } else if (b == 4) {
                tow4[f][r] += v;
            } b == 3 b 3 {
                tow3[f][r] += v;
            } tow3[f][r] += v tow3[f][r] tow3[f] tow3 f r v if (b == 4) {
                tow4[f][r] += v;
            } b == 4 b 4 {
                tow4[f][r] += v;
            } tow4[f][r] += v tow4[f][r] tow4[f] tow4 f r v for (int i = 0; i <= 2; i++) {
            for (int j = 0; j < 10; j++) {
                System.out.printf(" %d", tow1[i][j]);
            }
            System.out.println();
        } int i = 0; int i = 0; i 0 i <= 2 i 2 i++ i++ i {
            for (int j = 0; j < 10; j++) {
                System.out.printf(" %d", tow1[i][j]);
            }
            System.out.println();
        } {
            for (int j = 0; j < 10; j++) {
                System.out.printf(" %d", tow1[i][j]);
            }
            System.out.println();
        } for (int j = 0; j < 10; j++) {
                System.out.printf(" %d", tow1[i][j]);
            } int j = 0; int j = 0; j 0 j < 10 j 10 j++ j++ j {
                System.out.printf(" %d", tow1[i][j]);
            } {
                System.out.printf(" %d", tow1[i][j]);
            } System.out.printf(" %d", tow1[i][j]) System.out.printf System.out System System.out " %d" tow1[i][j] tow1[i] tow1 i j System.out.println() System.out.println System.out System System.out System.out.println("####################") System.out.println System.out System System.out "####################" for (int i = 0; i <= 2; i++) {
            for (int j = 0; j < 10; j++) {
                System.out.printf(" %d", tow2[i][j]);
            }
            System.out.println();
        } int i = 0; int i = 0; i 0 i <= 2 i 2 i++ i++ i {
            for (int j = 0; j < 10; j++) {
                System.out.printf(" %d", tow2[i][j]);
            }
            System.out.println();
        } {
            for (int j = 0; j < 10; j++) {
                System.out.printf(" %d", tow2[i][j]);
            }
            System.out.println();
        } for (int j = 0; j < 10; j++) {
                System.out.printf(" %d", tow2[i][j]);
            } int j = 0; int j = 0; j 0 j < 10 j 10 j++ j++ j {
                System.out.printf(" %d", tow2[i][j]);
            } {
                System.out.printf(" %d", tow2[i][j]);
            } System.out.printf(" %d", tow2[i][j]) System.out.printf System.out System System.out " %d" tow2[i][j] tow2[i] tow2 i j System.out.println() System.out.println System.out System System.out System.out.println("####################") System.out.println System.out System System.out "####################" for (int i = 0; i <= 2; i++) {
            for (int j = 0; j < 10; j++) {
                System.out.printf(" %d", tow3[i][j]);
            }
            System.out.println();
        } int i = 0; int i = 0; i 0 i <= 2 i 2 i++ i++ i {
            for (int j = 0; j < 10; j++) {
                System.out.printf(" %d", tow3[i][j]);
            }
            System.out.println();
        } {
            for (int j = 0; j < 10; j++) {
                System.out.printf(" %d", tow3[i][j]);
            }
            System.out.println();
        } for (int j = 0; j < 10; j++) {
                System.out.printf(" %d", tow3[i][j]);
            } int j = 0; int j = 0; j 0 j < 10 j 10 j++ j++ j {
                System.out.printf(" %d", tow3[i][j]);
            } {
                System.out.printf(" %d", tow3[i][j]);
            } System.out.printf(" %d", tow3[i][j]) System.out.printf System.out System System.out " %d" tow3[i][j] tow3[i] tow3 i j System.out.println() System.out.println System.out System System.out System.out.println("####################") System.out.println System.out System System.out "####################" for (int i = 0; i <= 2; i++) {
            for (int j = 0; j < 10; j++) {
                System.out.printf(" %d", tow4[i][j]);
            }
            System.out.println();
        } int i = 0; int i = 0; i 0 i <= 2 i 2 i++ i++ i {
            for (int j = 0; j < 10; j++) {
                System.out.printf(" %d", tow4[i][j]);
            }
            System.out.println();
        } {
            for (int j = 0; j < 10; j++) {
                System.out.printf(" %d", tow4[i][j]);
            }
            System.out.println();
        } for (int j = 0; j < 10; j++) {
                System.out.printf(" %d", tow4[i][j]);
            } int j = 0; int j = 0; j 0 j < 10 j 10 j++ j++ j {
                System.out.printf(" %d", tow4[i][j]);
            } {
                System.out.printf(" %d", tow4[i][j]);
            } System.out.printf(" %d", tow4[i][j]) System.out.printf System.out System System.out " %d" tow4[i][j] tow4[i] tow4 i j System.out.println() System.out.println System.out System System.out sc.close() sc.close sc String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[][] tow1 = new int[3][10];
        int[][] tow2 = new int[3][10];
        int[][] tow3 = new int[3][10];
        int[][] tow4 = new int[3][10];
        int b = 0, f = 0, r = 0, v = 0;
        int num = sc.nextInt();

        for (int i = 0; i < num; i++) {
            b = sc.nextInt();
            f = sc.nextInt()-1;
            r = sc.nextInt()-1;
            v = sc.nextInt();
            if (b == 1) {
                tow1[f][r] += v;
            } else if (b == 2) {
                tow2[f][r] += v;
            } else if (b == 3) {
                tow3[f][r] += v;
            } else if (b == 4) {
                tow4[f][r] += v;
            }
            
    }
        for (int i = 0; i <= 2; i++) {
            for (int j = 0; j < 10; j++) {
                System.out.printf(" %d", tow1[i][j]);
            }
            System.out.println();
        }
        System.out.println("####################");
        for (int i = 0; i <= 2; i++) {
            for (int j = 0; j < 10; j++) {
                System.out.printf(" %d", tow2[i][j]);
            }
            System.out.println();
        }
        System.out.println("####################");
        for (int i = 0; i <= 2; i++) {
            for (int j = 0; j < 10; j++) {
                System.out.printf(" %d", tow3[i][j]);
            }
            System.out.println();
        }
        System.out.println("####################");
        for (int i = 0; i <= 2; i++) {
            for (int j = 0; j < 10; j++) {
                System.out.printf(" %d", tow4[i][j]);
            }
            System.out.println();
        }

        sc.close();
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[][] tow1 = new int[3][10];
        int[][] tow2 = new int[3][10];
        int[][] tow3 = new int[3][10];
        int[][] tow4 = new int[3][10];
        int b = 0, f = 0, r = 0, v = 0;
        int num = sc.nextInt();

        for (int i = 0; i < num; i++) {
            b = sc.nextInt();
            f = sc.nextInt()-1;
            r = sc.nextInt()-1;
            v = sc.nextInt();
            if (b == 1) {
                tow1[f][r] += v;
            } else if (b == 2) {
                tow2[f][r] += v;
            } else if (b == 3) {
                tow3[f][r] += v;
            } else if (b == 4) {
                tow4[f][r] += v;
            }
            
    }
        for (int i = 0; i <= 2; i++) {
            for (int j = 0; j < 10; j++) {
                System.out.printf(" %d", tow1[i][j]);
            }
            System.out.println();
        }
        System.out.println("####################");
        for (int i = 0; i <= 2; i++) {
            for (int j = 0; j < 10; j++) {
                System.out.printf(" %d", tow2[i][j]);
            }
            System.out.println();
        }
        System.out.println("####################");
        for (int i = 0; i <= 2; i++) {
            for (int j = 0; j < 10; j++) {
                System.out.printf(" %d", tow3[i][j]);
            }
            System.out.println();
        }
        System.out.println("####################");
        for (int i = 0; i <= 2; i++) {
            for (int j = 0; j < 10; j++) {
                System.out.printf(" %d", tow4[i][j]);
            }
            System.out.println();
        }

        sc.close();
    }
} Main
import java.util.Scanner;


public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[][] tow1 = new int[3][10];
        int[][] tow2 = new int[3][10];
        int[][] tow3 = new int[3][10];
        int[][] tow4 = new int[3][10];
        int b = 0, f = 0, r = 0, v = 0;
        int num = sc.nextInt();

        for (int i = 0; i < num; i++) {
            b = sc.nextInt();
            f = sc.nextInt()-1;
            r = sc.nextInt()-1;
            v = sc.nextInt();
            if (b == 1) {
                tow1[f][r] += v;
            } else if (b == 2) {
                tow2[f][r] += v;
            } else if (b == 3) {
                tow3[f][r] += v;
            } else if (b == 4) {
                tow4[f][r] += v;
            }
            
    }
        for (int i = 0; i <= 2; i++) {
            for (int j = 0; j < 10; j++) {
                System.out.printf(" %d", tow1[i][j]);
            }
            System.out.println();
        }
        System.out.println("####################");
        for (int i = 0; i <= 2; i++) {
            for (int j = 0; j < 10; j++) {
                System.out.printf(" %d", tow2[i][j]);
            }
            System.out.println();
        }
        System.out.println("####################");
        for (int i = 0; i <= 2; i++) {
            for (int j = 0; j < 10; j++) {
                System.out.printf(" %d", tow3[i][j]);
            }
            System.out.println();
        }
        System.out.println("####################");
        for (int i = 0; i <= 2; i++) {
            for (int j = 0; j < 10; j++) {
                System.out.printf(" %d", tow4[i][j]);
            }
            System.out.println();
        }

        sc.close();
    }
}
