import java.io.*;
import java.util.Scanner;
import java.util.ArrayList;


public class Main {
    public static void main(String[] args)throws Exception{
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int b;
        int f;
        int r;
        int v;
        ArrayList<Integer> building1 = new ArrayList<Integer>();
        ArrayList<Integer> building2 = new ArrayList<Integer>();
        ArrayList<Integer> building3 = new ArrayList<Integer>();
        ArrayList<Integer> building4 = new ArrayList<Integer>();
        clear(building1);
        clear(building2);
        clear(building3);
        clear(building4);
        for(int i = 0;i <= n - 1;i++){
            b = scan.nextInt();
            f = scan.nextInt();
            r = scan.nextInt();
            v = scan.nextInt();
            switch(b){
                case 1:
                    vary(building1,f,r,v);
                    break;
                case 2:
                    vary(building2,f,r,v);
                    break;
                case 3:
                    vary(building3,f,r,v);
                    break;
                case 4:
                    vary(building4,f,r,v);
                    break;
            }
        }
        //出力
        dp(building1);
        System.out.println("####################");
        dp(building2);
        System.out.println("####################");
        dp(building3);
        System.out.println("####################");
        dp(building4);
    }

    public static void clear(ArrayList<Integer> building){
        for(int i = 0;i <= 29;i++){
            building.add(0);
        }    
    }
    
    //部屋の人数の処理
    public static void vary(ArrayList<Integer> building,int floor,int room,int number){
        building.set((floor - 1) * 10 + room - 1,building.get((floor - 1) * 10 + room - 1) + number);
    }
    
    //出力
    public static void dp(ArrayList<Integer> building){
        String st = "";
        for(int i = 0;i <= 29;i++){
            if(i <= 8){
                st += " " + building.get(i);
            }else if(i == 9){
                st += " " + building.get(i);
                System.out.println(st);
                st = "";
            }else if(i >= 10 && i <= 18){
                st += " " + building.get(i);
            }else if(i == 19){
                st += " " + building.get(i);
                System.out.println(st);
                st = "";
            }else if(i >= 20 && i <= 28){
                st += " " + building.get(i);
            }else if(i == 29){
                st += " " + building.get(i);
                System.out.println(st);
                st = "";
            }
        }
    }
} import java.io.*; io.* java import java.util.Scanner; Scanner java.util import java.util.ArrayList; ArrayList java.util public class Main {
    public static void main(String[] args)throws Exception{
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int b;
        int f;
        int r;
        int v;
        ArrayList<Integer> building1 = new ArrayList<Integer>();
        ArrayList<Integer> building2 = new ArrayList<Integer>();
        ArrayList<Integer> building3 = new ArrayList<Integer>();
        ArrayList<Integer> building4 = new ArrayList<Integer>();
        clear(building1);
        clear(building2);
        clear(building3);
        clear(building4);
        for(int i = 0;i <= n - 1;i++){
            b = scan.nextInt();
            f = scan.nextInt();
            r = scan.nextInt();
            v = scan.nextInt();
            switch(b){
                case 1:
                    vary(building1,f,r,v);
                    break;
                case 2:
                    vary(building2,f,r,v);
                    break;
                case 3:
                    vary(building3,f,r,v);
                    break;
                case 4:
                    vary(building4,f,r,v);
                    break;
            }
        }
        //出力
        dp(building1);
        System.out.println("####################");
        dp(building2);
        System.out.println("####################");
        dp(building3);
        System.out.println("####################");
        dp(building4);
    }

    public static void clear(ArrayList<Integer> building){
        for(int i = 0;i <= 29;i++){
            building.add(0);
        }    
    }
    
    //部屋の人数の処理
    public static void vary(ArrayList<Integer> building,int floor,int room,int number){
        building.set((floor - 1) * 10 + room - 1,building.get((floor - 1) * 10 + room - 1) + number);
    }
    
    //出力
    public static void dp(ArrayList<Integer> building){
        String st = "";
        for(int i = 0;i <= 29;i++){
            if(i <= 8){
                st += " " + building.get(i);
            }else if(i == 9){
                st += " " + building.get(i);
                System.out.println(st);
                st = "";
            }else if(i >= 10 && i <= 18){
                st += " " + building.get(i);
            }else if(i == 19){
                st += " " + building.get(i);
                System.out.println(st);
                st = "";
            }else if(i >= 20 && i <= 28){
                st += " " + building.get(i);
            }else if(i == 29){
                st += " " + building.get(i);
                System.out.println(st);
                st = "";
            }
        }
    }
} Main public static void main(String[] args)throws Exception{
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int b;
        int f;
        int r;
        int v;
        ArrayList<Integer> building1 = new ArrayList<Integer>();
        ArrayList<Integer> building2 = new ArrayList<Integer>();
        ArrayList<Integer> building3 = new ArrayList<Integer>();
        ArrayList<Integer> building4 = new ArrayList<Integer>();
        clear(building1);
        clear(building2);
        clear(building3);
        clear(building4);
        for(int i = 0;i <= n - 1;i++){
            b = scan.nextInt();
            f = scan.nextInt();
            r = scan.nextInt();
            v = scan.nextInt();
            switch(b){
                case 1:
                    vary(building1,f,r,v);
                    break;
                case 2:
                    vary(building2,f,r,v);
                    break;
                case 3:
                    vary(building3,f,r,v);
                    break;
                case 4:
                    vary(building4,f,r,v);
                    break;
            }
        }
        //出力
        dp(building1);
        System.out.println("####################");
        dp(building2);
        System.out.println("####################");
        dp(building3);
        System.out.println("####################");
        dp(building4);
    } main {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int b;
        int f;
        int r;
        int v;
        ArrayList<Integer> building1 = new ArrayList<Integer>();
        ArrayList<Integer> building2 = new ArrayList<Integer>();
        ArrayList<Integer> building3 = new ArrayList<Integer>();
        ArrayList<Integer> building4 = new ArrayList<Integer>();
        clear(building1);
        clear(building2);
        clear(building3);
        clear(building4);
        for(int i = 0;i <= n - 1;i++){
            b = scan.nextInt();
            f = scan.nextInt();
            r = scan.nextInt();
            v = scan.nextInt();
            switch(b){
                case 1:
                    vary(building1,f,r,v);
                    break;
                case 2:
                    vary(building2,f,r,v);
                    break;
                case 3:
                    vary(building3,f,r,v);
                    break;
                case 4:
                    vary(building4,f,r,v);
                    break;
            }
        }
        //出力
        dp(building1);
        System.out.println("####################");
        dp(building2);
        System.out.println("####################");
        dp(building3);
        System.out.println("####################");
        dp(building4);
    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan int b; b int f; f int r; r int v; v ArrayList<Integer> building1 = new ArrayList<Integer>(); building1 new ArrayList<Integer>() ArrayList<Integer> building2 = new ArrayList<Integer>(); building2 new ArrayList<Integer>() ArrayList<Integer> building3 = new ArrayList<Integer>(); building3 new ArrayList<Integer>() ArrayList<Integer> building4 = new ArrayList<Integer>(); building4 new ArrayList<Integer>() clear(building1) clear building1 clear(building2) clear building2 clear(building3) clear building3 clear(building4) clear building4 for(int i = 0;i <= n - 1;i++){
            b = scan.nextInt();
            f = scan.nextInt();
            r = scan.nextInt();
            v = scan.nextInt();
            switch(b){
                case 1:
                    vary(building1,f,r,v);
                    break;
                case 2:
                    vary(building2,f,r,v);
                    break;
                case 3:
                    vary(building3,f,r,v);
                    break;
                case 4:
                    vary(building4,f,r,v);
                    break;
            }
        } int i = 0; int i = 0; i 0 i <= n - 1 i n - 1 n 1 i++ i++ i {
            b = scan.nextInt();
            f = scan.nextInt();
            r = scan.nextInt();
            v = scan.nextInt();
            switch(b){
                case 1:
                    vary(building1,f,r,v);
                    break;
                case 2:
                    vary(building2,f,r,v);
                    break;
                case 3:
                    vary(building3,f,r,v);
                    break;
                case 4:
                    vary(building4,f,r,v);
                    break;
            }
        } {
            b = scan.nextInt();
            f = scan.nextInt();
            r = scan.nextInt();
            v = scan.nextInt();
            switch(b){
                case 1:
                    vary(building1,f,r,v);
                    break;
                case 2:
                    vary(building2,f,r,v);
                    break;
                case 3:
                    vary(building3,f,r,v);
                    break;
                case 4:
                    vary(building4,f,r,v);
                    break;
            }
        } b = scan.nextInt() b scan.nextInt() scan.nextInt scan f = scan.nextInt() f scan.nextInt() scan.nextInt scan r = scan.nextInt() r scan.nextInt() scan.nextInt scan v = scan.nextInt() v scan.nextInt() scan.nextInt scan switch(b){
                case 1:
                    vary(building1,f,r,v);
                    break;
                case 2:
                    vary(building2,f,r,v);
                    break;
                case 3:
                    vary(building3,f,r,v);
                    break;
                case 4:
                    vary(building4,f,r,v);
                    break;
            } b case 1: 1 case 1: vary(building1,f,r,v) vary building1 f r v break; case 2: 2 case 2: vary(building2,f,r,v) vary building2 f r v break; case 3: 3 case 3: vary(building3,f,r,v) vary building3 f r v break; case 4: 4 case 4: vary(building4,f,r,v) vary building4 f r v break; dp(building1) dp building1 System.out.println("####################") System.out.println System.out System System.out "####################" dp(building2) dp building2 System.out.println("####################") System.out.println System.out System System.out "####################" dp(building3) dp building3 System.out.println("####################") System.out.println System.out System System.out "####################" dp(building4) dp building4 String[] args args public static void clear(ArrayList<Integer> building){
        for(int i = 0;i <= 29;i++){
            building.add(0);
        }    
    } clear {
        for(int i = 0;i <= 29;i++){
            building.add(0);
        }    
    } for(int i = 0;i <= 29;i++){
            building.add(0);
        } int i = 0; int i = 0; i 0 i <= 29 i 29 i++ i++ i {
            building.add(0);
        } {
            building.add(0);
        } building.add(0) building.add building 0 ArrayList<Integer> building building //部屋の人数の処理
    public static void vary(ArrayList<Integer> building,int floor,int room,int number){
        building.set((floor - 1) * 10 + room - 1,building.get((floor - 1) * 10 + room - 1) + number);
    } vary {
        building.set((floor - 1) * 10 + room - 1,building.get((floor - 1) * 10 + room - 1) + number);
    } building.set((floor - 1) * 10 + room - 1,building.get((floor - 1) * 10 + room - 1) + number) building.set building (floor - 1) * 10 + room - 1 (floor - 1) * 10 + room (floor - 1) * 10 (floor - 1) floor 1 10 room 1 building.get((floor - 1) * 10 + room - 1) + number building.get((floor - 1) * 10 + room - 1) building.get building (floor - 1) * 10 + room - 1 (floor - 1) * 10 + room (floor - 1) * 10 (floor - 1) floor 1 10 room 1 number ArrayList<Integer> building building int floor floor int room room int number number //出力
    public static void dp(ArrayList<Integer> building){
        String st = "";
        for(int i = 0;i <= 29;i++){
            if(i <= 8){
                st += " " + building.get(i);
            }else if(i == 9){
                st += " " + building.get(i);
                System.out.println(st);
                st = "";
            }else if(i >= 10 && i <= 18){
                st += " " + building.get(i);
            }else if(i == 19){
                st += " " + building.get(i);
                System.out.println(st);
                st = "";
            }else if(i >= 20 && i <= 28){
                st += " " + building.get(i);
            }else if(i == 29){
                st += " " + building.get(i);
                System.out.println(st);
                st = "";
            }
        }
    } dp {
        String st = "";
        for(int i = 0;i <= 29;i++){
            if(i <= 8){
                st += " " + building.get(i);
            }else if(i == 9){
                st += " " + building.get(i);
                System.out.println(st);
                st = "";
            }else if(i >= 10 && i <= 18){
                st += " " + building.get(i);
            }else if(i == 19){
                st += " " + building.get(i);
                System.out.println(st);
                st = "";
            }else if(i >= 20 && i <= 28){
                st += " " + building.get(i);
            }else if(i == 29){
                st += " " + building.get(i);
                System.out.println(st);
                st = "";
            }
        }
    } String st = ""; st "" for(int i = 0;i <= 29;i++){
            if(i <= 8){
                st += " " + building.get(i);
            }else if(i == 9){
                st += " " + building.get(i);
                System.out.println(st);
                st = "";
            }else if(i >= 10 && i <= 18){
                st += " " + building.get(i);
            }else if(i == 19){
                st += " " + building.get(i);
                System.out.println(st);
                st = "";
            }else if(i >= 20 && i <= 28){
                st += " " + building.get(i);
            }else if(i == 29){
                st += " " + building.get(i);
                System.out.println(st);
                st = "";
            }
        } int i = 0; int i = 0; i 0 i <= 29 i 29 i++ i++ i {
            if(i <= 8){
                st += " " + building.get(i);
            }else if(i == 9){
                st += " " + building.get(i);
                System.out.println(st);
                st = "";
            }else if(i >= 10 && i <= 18){
                st += " " + building.get(i);
            }else if(i == 19){
                st += " " + building.get(i);
                System.out.println(st);
                st = "";
            }else if(i >= 20 && i <= 28){
                st += " " + building.get(i);
            }else if(i == 29){
                st += " " + building.get(i);
                System.out.println(st);
                st = "";
            }
        } {
            if(i <= 8){
                st += " " + building.get(i);
            }else if(i == 9){
                st += " " + building.get(i);
                System.out.println(st);
                st = "";
            }else if(i >= 10 && i <= 18){
                st += " " + building.get(i);
            }else if(i == 19){
                st += " " + building.get(i);
                System.out.println(st);
                st = "";
            }else if(i >= 20 && i <= 28){
                st += " " + building.get(i);
            }else if(i == 29){
                st += " " + building.get(i);
                System.out.println(st);
                st = "";
            }
        } if(i <= 8){
                st += " " + building.get(i);
            }else if(i == 9){
                st += " " + building.get(i);
                System.out.println(st);
                st = "";
            }else if(i >= 10 && i <= 18){
                st += " " + building.get(i);
            }else if(i == 19){
                st += " " + building.get(i);
                System.out.println(st);
                st = "";
            }else if(i >= 20 && i <= 28){
                st += " " + building.get(i);
            }else if(i == 29){
                st += " " + building.get(i);
                System.out.println(st);
                st = "";
            } i <= 8 i 8 {
                st += " " + building.get(i);
            } st += " " + building.get(i) st " " + building.get(i) " " building.get(i) building.get building i if(i == 9){
                st += " " + building.get(i);
                System.out.println(st);
                st = "";
            }else if(i >= 10 && i <= 18){
                st += " " + building.get(i);
            }else if(i == 19){
                st += " " + building.get(i);
                System.out.println(st);
                st = "";
            }else if(i >= 20 && i <= 28){
                st += " " + building.get(i);
            }else if(i == 29){
                st += " " + building.get(i);
                System.out.println(st);
                st = "";
            } i == 9 i 9 {
                st += " " + building.get(i);
                System.out.println(st);
                st = "";
            } st += " " + building.get(i) st " " + building.get(i) " " building.get(i) building.get building i System.out.println(st) System.out.println System.out System System.out st st = "" st "" if(i >= 10 && i <= 18){
                st += " " + building.get(i);
            }else if(i == 19){
                st += " " + building.get(i);
                System.out.println(st);
                st = "";
            }else if(i >= 20 && i <= 28){
                st += " " + building.get(i);
            }else if(i == 29){
                st += " " + building.get(i);
                System.out.println(st);
                st = "";
            } i >= 10 && i <= 18 i >= 10 i 10 i <= 18 i 18 {
                st += " " + building.get(i);
            } st += " " + building.get(i) st " " + building.get(i) " " building.get(i) building.get building i if(i == 19){
                st += " " + building.get(i);
                System.out.println(st);
                st = "";
            }else if(i >= 20 && i <= 28){
                st += " " + building.get(i);
            }else if(i == 29){
                st += " " + building.get(i);
                System.out.println(st);
                st = "";
            } i == 19 i 19 {
                st += " " + building.get(i);
                System.out.println(st);
                st = "";
            } st += " " + building.get(i) st " " + building.get(i) " " building.get(i) building.get building i System.out.println(st) System.out.println System.out System System.out st st = "" st "" if(i >= 20 && i <= 28){
                st += " " + building.get(i);
            }else if(i == 29){
                st += " " + building.get(i);
                System.out.println(st);
                st = "";
            } i >= 20 && i <= 28 i >= 20 i 20 i <= 28 i 28 {
                st += " " + building.get(i);
            } st += " " + building.get(i) st " " + building.get(i) " " building.get(i) building.get building i if(i == 29){
                st += " " + building.get(i);
                System.out.println(st);
                st = "";
            } i == 29 i 29 {
                st += " " + building.get(i);
                System.out.println(st);
                st = "";
            } st += " " + building.get(i) st " " + building.get(i) " " building.get(i) building.get building i System.out.println(st) System.out.println System.out System System.out st st = "" st "" ArrayList<Integer> building building public class Main {
    public static void main(String[] args)throws Exception{
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int b;
        int f;
        int r;
        int v;
        ArrayList<Integer> building1 = new ArrayList<Integer>();
        ArrayList<Integer> building2 = new ArrayList<Integer>();
        ArrayList<Integer> building3 = new ArrayList<Integer>();
        ArrayList<Integer> building4 = new ArrayList<Integer>();
        clear(building1);
        clear(building2);
        clear(building3);
        clear(building4);
        for(int i = 0;i <= n - 1;i++){
            b = scan.nextInt();
            f = scan.nextInt();
            r = scan.nextInt();
            v = scan.nextInt();
            switch(b){
                case 1:
                    vary(building1,f,r,v);
                    break;
                case 2:
                    vary(building2,f,r,v);
                    break;
                case 3:
                    vary(building3,f,r,v);
                    break;
                case 4:
                    vary(building4,f,r,v);
                    break;
            }
        }
        //出力
        dp(building1);
        System.out.println("####################");
        dp(building2);
        System.out.println("####################");
        dp(building3);
        System.out.println("####################");
        dp(building4);
    }

    public static void clear(ArrayList<Integer> building){
        for(int i = 0;i <= 29;i++){
            building.add(0);
        }    
    }
    
    //部屋の人数の処理
    public static void vary(ArrayList<Integer> building,int floor,int room,int number){
        building.set((floor - 1) * 10 + room - 1,building.get((floor - 1) * 10 + room - 1) + number);
    }
    
    //出力
    public static void dp(ArrayList<Integer> building){
        String st = "";
        for(int i = 0;i <= 29;i++){
            if(i <= 8){
                st += " " + building.get(i);
            }else if(i == 9){
                st += " " + building.get(i);
                System.out.println(st);
                st = "";
            }else if(i >= 10 && i <= 18){
                st += " " + building.get(i);
            }else if(i == 19){
                st += " " + building.get(i);
                System.out.println(st);
                st = "";
            }else if(i >= 20 && i <= 28){
                st += " " + building.get(i);
            }else if(i == 29){
                st += " " + building.get(i);
                System.out.println(st);
                st = "";
            }
        }
    }
} public class Main {
    public static void main(String[] args)throws Exception{
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int b;
        int f;
        int r;
        int v;
        ArrayList<Integer> building1 = new ArrayList<Integer>();
        ArrayList<Integer> building2 = new ArrayList<Integer>();
        ArrayList<Integer> building3 = new ArrayList<Integer>();
        ArrayList<Integer> building4 = new ArrayList<Integer>();
        clear(building1);
        clear(building2);
        clear(building3);
        clear(building4);
        for(int i = 0;i <= n - 1;i++){
            b = scan.nextInt();
            f = scan.nextInt();
            r = scan.nextInt();
            v = scan.nextInt();
            switch(b){
                case 1:
                    vary(building1,f,r,v);
                    break;
                case 2:
                    vary(building2,f,r,v);
                    break;
                case 3:
                    vary(building3,f,r,v);
                    break;
                case 4:
                    vary(building4,f,r,v);
                    break;
            }
        }
        //出力
        dp(building1);
        System.out.println("####################");
        dp(building2);
        System.out.println("####################");
        dp(building3);
        System.out.println("####################");
        dp(building4);
    }

    public static void clear(ArrayList<Integer> building){
        for(int i = 0;i <= 29;i++){
            building.add(0);
        }    
    }
    
    //部屋の人数の処理
    public static void vary(ArrayList<Integer> building,int floor,int room,int number){
        building.set((floor - 1) * 10 + room - 1,building.get((floor - 1) * 10 + room - 1) + number);
    }
    
    //出力
    public static void dp(ArrayList<Integer> building){
        String st = "";
        for(int i = 0;i <= 29;i++){
            if(i <= 8){
                st += " " + building.get(i);
            }else if(i == 9){
                st += " " + building.get(i);
                System.out.println(st);
                st = "";
            }else if(i >= 10 && i <= 18){
                st += " " + building.get(i);
            }else if(i == 19){
                st += " " + building.get(i);
                System.out.println(st);
                st = "";
            }else if(i >= 20 && i <= 28){
                st += " " + building.get(i);
            }else if(i == 29){
                st += " " + building.get(i);
                System.out.println(st);
                st = "";
            }
        }
    }
} Main
import java.io.*;
import java.util.Scanner;
import java.util.ArrayList;


public class Main {
    public static void main(String[] args)throws Exception{
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int b;
        int f;
        int r;
        int v;
        ArrayList<Integer> building1 = new ArrayList<Integer>();
        ArrayList<Integer> building2 = new ArrayList<Integer>();
        ArrayList<Integer> building3 = new ArrayList<Integer>();
        ArrayList<Integer> building4 = new ArrayList<Integer>();
        clear(building1);
        clear(building2);
        clear(building3);
        clear(building4);
        for(int i = 0;i <= n - 1;i++){
            b = scan.nextInt();
            f = scan.nextInt();
            r = scan.nextInt();
            v = scan.nextInt();
            switch(b){
                case 1:
                    vary(building1,f,r,v);
                    break;
                case 2:
                    vary(building2,f,r,v);
                    break;
                case 3:
                    vary(building3,f,r,v);
                    break;
                case 4:
                    vary(building4,f,r,v);
                    break;
            }
        }
        //出力
        dp(building1);
        System.out.println("####################");
        dp(building2);
        System.out.println("####################");
        dp(building3);
        System.out.println("####################");
        dp(building4);
    }

    public static void clear(ArrayList<Integer> building){
        for(int i = 0;i <= 29;i++){
            building.add(0);
        }    
    }
    
    //部屋の人数の処理
    public static void vary(ArrayList<Integer> building,int floor,int room,int number){
        building.set((floor - 1) * 10 + room - 1,building.get((floor - 1) * 10 + room - 1) + number);
    }
    
    //出力
    public static void dp(ArrayList<Integer> building){
        String st = "";
        for(int i = 0;i <= 29;i++){
            if(i <= 8){
                st += " " + building.get(i);
            }else if(i == 9){
                st += " " + building.get(i);
                System.out.println(st);
                st = "";
            }else if(i >= 10 && i <= 18){
                st += " " + building.get(i);
            }else if(i == 19){
                st += " " + building.get(i);
                System.out.println(st);
                st = "";
            }else if(i >= 20 && i <= 28){
                st += " " + building.get(i);
            }else if(i == 29){
                st += " " + building.get(i);
                System.out.println(st);
                st = "";
            }
        }
    }
}
