import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        // Here your code !
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String cou = br.readLine();
        int count = Integer.parseInt(cou);
        int[][] t1 = new int[3][10];
        int[][] t2 = new int[3][10];
        int[][] t3 = new int[3][10];
        int[][] t4 = new int[3][10];
        int i=0;
        init(t1);
        init(t2);
        init(t3);
        init(t4);
        while(i<count) {
            String line = br.readLine();
            String[] line2 = line.split(" ");
            switch(Integer.parseInt(line2[0])) {
                case 1:
                    add(t1,Integer.parseInt(line2[1]),Integer.parseInt(line2[2]),Integer.parseInt(line2[3]));
                    break;
                case 2:
                    add(t2,Integer.parseInt(line2[1]),Integer.parseInt(line2[2]),Integer.parseInt(line2[3]));
                    break;
                case 3:
                    add(t3,Integer.parseInt(line2[1]),Integer.parseInt(line2[2]),Integer.parseInt(line2[3]));
                    break;
                case 4:
                    add(t4,Integer.parseInt(line2[1]),Integer.parseInt(line2[2]),Integer.parseInt(line2[3]));
                    break;
                default:
                    break;
            }
            i++;
        }
        print(t1);
        punc();
        print(t2);
        punc();
        print(t3);
        punc();
        print(t4);
    }
    static void init(int[][] ary) {
        for(int i=0;i<ary.length;i++) {
            for(int j=0;j<ary[i].length;j++) {
                ary[i][j]=0;
            }
        }
    }
    static void print(int[][] tag) {
        for(int i=0;i<tag.length;i++) {
            for(int j=0;j<tag[i].length;j++) {
                System.out.print(" " + tag[i][j]);
            }
            System.out.println();
        }
    }
    static void punc() {
        System.out.println("####################");
    }
    //1 1 3 8 1棟1階3番目の部屋に+8人
    static void add(int[][] ren,int floor,int room,int num) {
            ren[floor-1][room-1] += num;
    }
  
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.*; util.* java public class Main {
    public static void main(String[] args) throws Exception {
        // Here your code !
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String cou = br.readLine();
        int count = Integer.parseInt(cou);
        int[][] t1 = new int[3][10];
        int[][] t2 = new int[3][10];
        int[][] t3 = new int[3][10];
        int[][] t4 = new int[3][10];
        int i=0;
        init(t1);
        init(t2);
        init(t3);
        init(t4);
        while(i<count) {
            String line = br.readLine();
            String[] line2 = line.split(" ");
            switch(Integer.parseInt(line2[0])) {
                case 1:
                    add(t1,Integer.parseInt(line2[1]),Integer.parseInt(line2[2]),Integer.parseInt(line2[3]));
                    break;
                case 2:
                    add(t2,Integer.parseInt(line2[1]),Integer.parseInt(line2[2]),Integer.parseInt(line2[3]));
                    break;
                case 3:
                    add(t3,Integer.parseInt(line2[1]),Integer.parseInt(line2[2]),Integer.parseInt(line2[3]));
                    break;
                case 4:
                    add(t4,Integer.parseInt(line2[1]),Integer.parseInt(line2[2]),Integer.parseInt(line2[3]));
                    break;
                default:
                    break;
            }
            i++;
        }
        print(t1);
        punc();
        print(t2);
        punc();
        print(t3);
        punc();
        print(t4);
    }
    static void init(int[][] ary) {
        for(int i=0;i<ary.length;i++) {
            for(int j=0;j<ary[i].length;j++) {
                ary[i][j]=0;
            }
        }
    }
    static void print(int[][] tag) {
        for(int i=0;i<tag.length;i++) {
            for(int j=0;j<tag[i].length;j++) {
                System.out.print(" " + tag[i][j]);
            }
            System.out.println();
        }
    }
    static void punc() {
        System.out.println("####################");
    }
    //1 1 3 8 1棟1階3番目の部屋に+8人
    static void add(int[][] ren,int floor,int room,int num) {
            ren[floor-1][room-1] += num;
    }
  
} Main public static void main(String[] args) throws Exception {
        // Here your code !
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String cou = br.readLine();
        int count = Integer.parseInt(cou);
        int[][] t1 = new int[3][10];
        int[][] t2 = new int[3][10];
        int[][] t3 = new int[3][10];
        int[][] t4 = new int[3][10];
        int i=0;
        init(t1);
        init(t2);
        init(t3);
        init(t4);
        while(i<count) {
            String line = br.readLine();
            String[] line2 = line.split(" ");
            switch(Integer.parseInt(line2[0])) {
                case 1:
                    add(t1,Integer.parseInt(line2[1]),Integer.parseInt(line2[2]),Integer.parseInt(line2[3]));
                    break;
                case 2:
                    add(t2,Integer.parseInt(line2[1]),Integer.parseInt(line2[2]),Integer.parseInt(line2[3]));
                    break;
                case 3:
                    add(t3,Integer.parseInt(line2[1]),Integer.parseInt(line2[2]),Integer.parseInt(line2[3]));
                    break;
                case 4:
                    add(t4,Integer.parseInt(line2[1]),Integer.parseInt(line2[2]),Integer.parseInt(line2[3]));
                    break;
                default:
                    break;
            }
            i++;
        }
        print(t1);
        punc();
        print(t2);
        punc();
        print(t3);
        punc();
        print(t4);
    } main {
        // Here your code !
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String cou = br.readLine();
        int count = Integer.parseInt(cou);
        int[][] t1 = new int[3][10];
        int[][] t2 = new int[3][10];
        int[][] t3 = new int[3][10];
        int[][] t4 = new int[3][10];
        int i=0;
        init(t1);
        init(t2);
        init(t3);
        init(t4);
        while(i<count) {
            String line = br.readLine();
            String[] line2 = line.split(" ");
            switch(Integer.parseInt(line2[0])) {
                case 1:
                    add(t1,Integer.parseInt(line2[1]),Integer.parseInt(line2[2]),Integer.parseInt(line2[3]));
                    break;
                case 2:
                    add(t2,Integer.parseInt(line2[1]),Integer.parseInt(line2[2]),Integer.parseInt(line2[3]));
                    break;
                case 3:
                    add(t3,Integer.parseInt(line2[1]),Integer.parseInt(line2[2]),Integer.parseInt(line2[3]));
                    break;
                case 4:
                    add(t4,Integer.parseInt(line2[1]),Integer.parseInt(line2[2]),Integer.parseInt(line2[3]));
                    break;
                default:
                    break;
            }
            i++;
        }
        print(t1);
        punc();
        print(t2);
        punc();
        print(t3);
        punc();
        print(t4);
    } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String cou = br.readLine(); cou br.readLine() br.readLine br int count = Integer.parseInt(cou); count Integer.parseInt(cou) Integer.parseInt Integer cou int[][] t1 = new int[3][10]; t1 new int[3][10] 3 10 int[][] t2 = new int[3][10]; t2 new int[3][10] 3 10 int[][] t3 = new int[3][10]; t3 new int[3][10] 3 10 int[][] t4 = new int[3][10]; t4 new int[3][10] 3 10 int i=0; i 0 init(t1) init t1 init(t2) init t2 init(t3) init t3 init(t4) init t4 while(i<count) {
            String line = br.readLine();
            String[] line2 = line.split(" ");
            switch(Integer.parseInt(line2[0])) {
                case 1:
                    add(t1,Integer.parseInt(line2[1]),Integer.parseInt(line2[2]),Integer.parseInt(line2[3]));
                    break;
                case 2:
                    add(t2,Integer.parseInt(line2[1]),Integer.parseInt(line2[2]),Integer.parseInt(line2[3]));
                    break;
                case 3:
                    add(t3,Integer.parseInt(line2[1]),Integer.parseInt(line2[2]),Integer.parseInt(line2[3]));
                    break;
                case 4:
                    add(t4,Integer.parseInt(line2[1]),Integer.parseInt(line2[2]),Integer.parseInt(line2[3]));
                    break;
                default:
                    break;
            }
            i++;
        } i<count i count {
            String line = br.readLine();
            String[] line2 = line.split(" ");
            switch(Integer.parseInt(line2[0])) {
                case 1:
                    add(t1,Integer.parseInt(line2[1]),Integer.parseInt(line2[2]),Integer.parseInt(line2[3]));
                    break;
                case 2:
                    add(t2,Integer.parseInt(line2[1]),Integer.parseInt(line2[2]),Integer.parseInt(line2[3]));
                    break;
                case 3:
                    add(t3,Integer.parseInt(line2[1]),Integer.parseInt(line2[2]),Integer.parseInt(line2[3]));
                    break;
                case 4:
                    add(t4,Integer.parseInt(line2[1]),Integer.parseInt(line2[2]),Integer.parseInt(line2[3]));
                    break;
                default:
                    break;
            }
            i++;
        } String line = br.readLine(); line br.readLine() br.readLine br String[] line2 = line.split(" "); line2 line.split(" ") line.split line " " switch(Integer.parseInt(line2[0])) {
                case 1:
                    add(t1,Integer.parseInt(line2[1]),Integer.parseInt(line2[2]),Integer.parseInt(line2[3]));
                    break;
                case 2:
                    add(t2,Integer.parseInt(line2[1]),Integer.parseInt(line2[2]),Integer.parseInt(line2[3]));
                    break;
                case 3:
                    add(t3,Integer.parseInt(line2[1]),Integer.parseInt(line2[2]),Integer.parseInt(line2[3]));
                    break;
                case 4:
                    add(t4,Integer.parseInt(line2[1]),Integer.parseInt(line2[2]),Integer.parseInt(line2[3]));
                    break;
                default:
                    break;
            } Integer.parseInt(line2[0]) Integer.parseInt Integer line2[0] line2 0 case 1: 1 case 1: add(t1,Integer.parseInt(line2[1]),Integer.parseInt(line2[2]),Integer.parseInt(line2[3])) add t1 Integer.parseInt(line2[1]) Integer.parseInt Integer line2[1] line2 1 Integer.parseInt(line2[2]) Integer.parseInt Integer line2[2] line2 2 Integer.parseInt(line2[3]) Integer.parseInt Integer line2[3] line2 3 break; case 2: 2 case 2: add(t2,Integer.parseInt(line2[1]),Integer.parseInt(line2[2]),Integer.parseInt(line2[3])) add t2 Integer.parseInt(line2[1]) Integer.parseInt Integer line2[1] line2 1 Integer.parseInt(line2[2]) Integer.parseInt Integer line2[2] line2 2 Integer.parseInt(line2[3]) Integer.parseInt Integer line2[3] line2 3 break; case 3: 3 case 3: add(t3,Integer.parseInt(line2[1]),Integer.parseInt(line2[2]),Integer.parseInt(line2[3])) add t3 Integer.parseInt(line2[1]) Integer.parseInt Integer line2[1] line2 1 Integer.parseInt(line2[2]) Integer.parseInt Integer line2[2] line2 2 Integer.parseInt(line2[3]) Integer.parseInt Integer line2[3] line2 3 break; case 4: 4 case 4: add(t4,Integer.parseInt(line2[1]),Integer.parseInt(line2[2]),Integer.parseInt(line2[3])) add t4 Integer.parseInt(line2[1]) Integer.parseInt Integer line2[1] line2 1 Integer.parseInt(line2[2]) Integer.parseInt Integer line2[2] line2 2 Integer.parseInt(line2[3]) Integer.parseInt Integer line2[3] line2 3 break; default: default: break; i++ i print(t1) print t1 punc() punc print(t2) print t2 punc() punc print(t3) print t3 punc() punc print(t4) print t4 String[] args args static void init(int[][] ary) {
        for(int i=0;i<ary.length;i++) {
            for(int j=0;j<ary[i].length;j++) {
                ary[i][j]=0;
            }
        }
    } init {
        for(int i=0;i<ary.length;i++) {
            for(int j=0;j<ary[i].length;j++) {
                ary[i][j]=0;
            }
        }
    } for(int i=0;i<ary.length;i++) {
            for(int j=0;j<ary[i].length;j++) {
                ary[i][j]=0;
            }
        } int i=0; int i=0; i 0 i<ary.length i ary.length ary ary.length i++ i++ i {
            for(int j=0;j<ary[i].length;j++) {
                ary[i][j]=0;
            }
        } {
            for(int j=0;j<ary[i].length;j++) {
                ary[i][j]=0;
            }
        } for(int j=0;j<ary[i].length;j++) {
                ary[i][j]=0;
            } int j=0; int j=0; j 0 j<ary[i].length j ary[i].length ary[i] ary i ary[i].length j++ j++ j {
                ary[i][j]=0;
            } {
                ary[i][j]=0;
            } ary[i][j]=0 ary[i][j] ary[i] ary i j 0 int[][] ary ary static void print(int[][] tag) {
        for(int i=0;i<tag.length;i++) {
            for(int j=0;j<tag[i].length;j++) {
                System.out.print(" " + tag[i][j]);
            }
            System.out.println();
        }
    } print {
        for(int i=0;i<tag.length;i++) {
            for(int j=0;j<tag[i].length;j++) {
                System.out.print(" " + tag[i][j]);
            }
            System.out.println();
        }
    } for(int i=0;i<tag.length;i++) {
            for(int j=0;j<tag[i].length;j++) {
                System.out.print(" " + tag[i][j]);
            }
            System.out.println();
        } int i=0; int i=0; i 0 i<tag.length i tag.length tag tag.length i++ i++ i {
            for(int j=0;j<tag[i].length;j++) {
                System.out.print(" " + tag[i][j]);
            }
            System.out.println();
        } {
            for(int j=0;j<tag[i].length;j++) {
                System.out.print(" " + tag[i][j]);
            }
            System.out.println();
        } for(int j=0;j<tag[i].length;j++) {
                System.out.print(" " + tag[i][j]);
            } int j=0; int j=0; j 0 j<tag[i].length j tag[i].length tag[i] tag i tag[i].length j++ j++ j {
                System.out.print(" " + tag[i][j]);
            } {
                System.out.print(" " + tag[i][j]);
            } System.out.print(" " + tag[i][j]) System.out.print System.out System System.out " " + tag[i][j] " " tag[i][j] tag[i] tag i j System.out.println() System.out.println System.out System System.out int[][] tag tag static void punc() {
        System.out.println("####################");
    } punc {
        System.out.println("####################");
    } System.out.println("####################") System.out.println System.out System System.out "####################" //1 1 3 8 1棟1階3番目の部屋に+8人
    static void add(int[][] ren,int floor,int room,int num) {
            ren[floor-1][room-1] += num;
    } add {
            ren[floor-1][room-1] += num;
    } ren[floor-1][room-1] += num ren[floor-1][room-1] ren[floor-1] ren floor-1 floor 1 room-1 room 1 num int[][] ren ren int floor floor int room room int num num public class Main {
    public static void main(String[] args) throws Exception {
        // Here your code !
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String cou = br.readLine();
        int count = Integer.parseInt(cou);
        int[][] t1 = new int[3][10];
        int[][] t2 = new int[3][10];
        int[][] t3 = new int[3][10];
        int[][] t4 = new int[3][10];
        int i=0;
        init(t1);
        init(t2);
        init(t3);
        init(t4);
        while(i<count) {
            String line = br.readLine();
            String[] line2 = line.split(" ");
            switch(Integer.parseInt(line2[0])) {
                case 1:
                    add(t1,Integer.parseInt(line2[1]),Integer.parseInt(line2[2]),Integer.parseInt(line2[3]));
                    break;
                case 2:
                    add(t2,Integer.parseInt(line2[1]),Integer.parseInt(line2[2]),Integer.parseInt(line2[3]));
                    break;
                case 3:
                    add(t3,Integer.parseInt(line2[1]),Integer.parseInt(line2[2]),Integer.parseInt(line2[3]));
                    break;
                case 4:
                    add(t4,Integer.parseInt(line2[1]),Integer.parseInt(line2[2]),Integer.parseInt(line2[3]));
                    break;
                default:
                    break;
            }
            i++;
        }
        print(t1);
        punc();
        print(t2);
        punc();
        print(t3);
        punc();
        print(t4);
    }
    static void init(int[][] ary) {
        for(int i=0;i<ary.length;i++) {
            for(int j=0;j<ary[i].length;j++) {
                ary[i][j]=0;
            }
        }
    }
    static void print(int[][] tag) {
        for(int i=0;i<tag.length;i++) {
            for(int j=0;j<tag[i].length;j++) {
                System.out.print(" " + tag[i][j]);
            }
            System.out.println();
        }
    }
    static void punc() {
        System.out.println("####################");
    }
    //1 1 3 8 1棟1階3番目の部屋に+8人
    static void add(int[][] ren,int floor,int room,int num) {
            ren[floor-1][room-1] += num;
    }
  
} public class Main {
    public static void main(String[] args) throws Exception {
        // Here your code !
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String cou = br.readLine();
        int count = Integer.parseInt(cou);
        int[][] t1 = new int[3][10];
        int[][] t2 = new int[3][10];
        int[][] t3 = new int[3][10];
        int[][] t4 = new int[3][10];
        int i=0;
        init(t1);
        init(t2);
        init(t3);
        init(t4);
        while(i<count) {
            String line = br.readLine();
            String[] line2 = line.split(" ");
            switch(Integer.parseInt(line2[0])) {
                case 1:
                    add(t1,Integer.parseInt(line2[1]),Integer.parseInt(line2[2]),Integer.parseInt(line2[3]));
                    break;
                case 2:
                    add(t2,Integer.parseInt(line2[1]),Integer.parseInt(line2[2]),Integer.parseInt(line2[3]));
                    break;
                case 3:
                    add(t3,Integer.parseInt(line2[1]),Integer.parseInt(line2[2]),Integer.parseInt(line2[3]));
                    break;
                case 4:
                    add(t4,Integer.parseInt(line2[1]),Integer.parseInt(line2[2]),Integer.parseInt(line2[3]));
                    break;
                default:
                    break;
            }
            i++;
        }
        print(t1);
        punc();
        print(t2);
        punc();
        print(t3);
        punc();
        print(t4);
    }
    static void init(int[][] ary) {
        for(int i=0;i<ary.length;i++) {
            for(int j=0;j<ary[i].length;j++) {
                ary[i][j]=0;
            }
        }
    }
    static void print(int[][] tag) {
        for(int i=0;i<tag.length;i++) {
            for(int j=0;j<tag[i].length;j++) {
                System.out.print(" " + tag[i][j]);
            }
            System.out.println();
        }
    }
    static void punc() {
        System.out.println("####################");
    }
    //1 1 3 8 1棟1階3番目の部屋に+8人
    static void add(int[][] ren,int floor,int room,int num) {
            ren[floor-1][room-1] += num;
    }
  
} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        // Here your code !
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String cou = br.readLine();
        int count = Integer.parseInt(cou);
        int[][] t1 = new int[3][10];
        int[][] t2 = new int[3][10];
        int[][] t3 = new int[3][10];
        int[][] t4 = new int[3][10];
        int i=0;
        init(t1);
        init(t2);
        init(t3);
        init(t4);
        while(i<count) {
            String line = br.readLine();
            String[] line2 = line.split(" ");
            switch(Integer.parseInt(line2[0])) {
                case 1:
                    add(t1,Integer.parseInt(line2[1]),Integer.parseInt(line2[2]),Integer.parseInt(line2[3]));
                    break;
                case 2:
                    add(t2,Integer.parseInt(line2[1]),Integer.parseInt(line2[2]),Integer.parseInt(line2[3]));
                    break;
                case 3:
                    add(t3,Integer.parseInt(line2[1]),Integer.parseInt(line2[2]),Integer.parseInt(line2[3]));
                    break;
                case 4:
                    add(t4,Integer.parseInt(line2[1]),Integer.parseInt(line2[2]),Integer.parseInt(line2[3]));
                    break;
                default:
                    break;
            }
            i++;
        }
        print(t1);
        punc();
        print(t2);
        punc();
        print(t3);
        punc();
        print(t4);
    }
    static void init(int[][] ary) {
        for(int i=0;i<ary.length;i++) {
            for(int j=0;j<ary[i].length;j++) {
                ary[i][j]=0;
            }
        }
    }
    static void print(int[][] tag) {
        for(int i=0;i<tag.length;i++) {
            for(int j=0;j<tag[i].length;j++) {
                System.out.print(" " + tag[i][j]);
            }
            System.out.println();
        }
    }
    static void punc() {
        System.out.println("####################");
    }
    //1 1 3 8 1棟1階3番目の部屋に+8人
    static void add(int[][] ren,int floor,int room,int num) {
            ren[floor-1][room-1] += num;
    }
  
}