import java.util.Scanner;

public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int num = sc.nextInt();
        int[][] array = new int[num][4];
        int[][] tenant = new int[12][10];
        
        for(int i = 0; i < num; i++){
            for(int j = 0; j < 4; j++){
                array[i][j] = sc.nextInt();
            }
            int floor = (array[i][0] - 1) * 3 + array[i][1] - 1;
            int room = array[i][2] - 1;
            tenant[floor][room] += array[i][3];
            if(tenant[floor][room] < 0){
                tenant[floor][room] = 0;
            }
            
        }
        
        for(int i = 0; i < 12; i++){
            if(i != 0 && i % 3 == 0){
                System.out.println("####################");
            }
            for(int j = 0; j < 10; j++){
                System.out.print(" " + tenant[i][j]);
            }
            System.out.println();
        }
    }
} import java.util.Scanner; Scanner java.util public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int num = sc.nextInt();
        int[][] array = new int[num][4];
        int[][] tenant = new int[12][10];
        
        for(int i = 0; i < num; i++){
            for(int j = 0; j < 4; j++){
                array[i][j] = sc.nextInt();
            }
            int floor = (array[i][0] - 1) * 3 + array[i][1] - 1;
            int room = array[i][2] - 1;
            tenant[floor][room] += array[i][3];
            if(tenant[floor][room] < 0){
                tenant[floor][room] = 0;
            }
            
        }
        
        for(int i = 0; i < 12; i++){
            if(i != 0 && i % 3 == 0){
                System.out.println("####################");
            }
            for(int j = 0; j < 10; j++){
                System.out.print(" " + tenant[i][j]);
            }
            System.out.println();
        }
    }
} Main public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int num = sc.nextInt();
        int[][] array = new int[num][4];
        int[][] tenant = new int[12][10];
        
        for(int i = 0; i < num; i++){
            for(int j = 0; j < 4; j++){
                array[i][j] = sc.nextInt();
            }
            int floor = (array[i][0] - 1) * 3 + array[i][1] - 1;
            int room = array[i][2] - 1;
            tenant[floor][room] += array[i][3];
            if(tenant[floor][room] < 0){
                tenant[floor][room] = 0;
            }
            
        }
        
        for(int i = 0; i < 12; i++){
            if(i != 0 && i % 3 == 0){
                System.out.println("####################");
            }
            for(int j = 0; j < 10; j++){
                System.out.print(" " + tenant[i][j]);
            }
            System.out.println();
        }
    } main {
        Scanner sc = new Scanner(System.in);
        int num = sc.nextInt();
        int[][] array = new int[num][4];
        int[][] tenant = new int[12][10];
        
        for(int i = 0; i < num; i++){
            for(int j = 0; j < 4; j++){
                array[i][j] = sc.nextInt();
            }
            int floor = (array[i][0] - 1) * 3 + array[i][1] - 1;
            int room = array[i][2] - 1;
            tenant[floor][room] += array[i][3];
            if(tenant[floor][room] < 0){
                tenant[floor][room] = 0;
            }
            
        }
        
        for(int i = 0; i < 12; i++){
            if(i != 0 && i % 3 == 0){
                System.out.println("####################");
            }
            for(int j = 0; j < 10; j++){
                System.out.print(" " + tenant[i][j]);
            }
            System.out.println();
        }
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int num = sc.nextInt(); num sc.nextInt() sc.nextInt sc int[][] array = new int[num][4]; array new int[num][4] num 4 int[][] tenant = new int[12][10]; tenant new int[12][10] 12 10 for(int i = 0; i < num; i++){
            for(int j = 0; j < 4; j++){
                array[i][j] = sc.nextInt();
            }
            int floor = (array[i][0] - 1) * 3 + array[i][1] - 1;
            int room = array[i][2] - 1;
            tenant[floor][room] += array[i][3];
            if(tenant[floor][room] < 0){
                tenant[floor][room] = 0;
            }
            
        } int i = 0; int i = 0; i 0 i < num i num i++ i++ i {
            for(int j = 0; j < 4; j++){
                array[i][j] = sc.nextInt();
            }
            int floor = (array[i][0] - 1) * 3 + array[i][1] - 1;
            int room = array[i][2] - 1;
            tenant[floor][room] += array[i][3];
            if(tenant[floor][room] < 0){
                tenant[floor][room] = 0;
            }
            
        } {
            for(int j = 0; j < 4; j++){
                array[i][j] = sc.nextInt();
            }
            int floor = (array[i][0] - 1) * 3 + array[i][1] - 1;
            int room = array[i][2] - 1;
            tenant[floor][room] += array[i][3];
            if(tenant[floor][room] < 0){
                tenant[floor][room] = 0;
            }
            
        } for(int j = 0; j < 4; j++){
                array[i][j] = sc.nextInt();
            } int j = 0; int j = 0; j 0 j < 4 j 4 j++ j++ j {
                array[i][j] = sc.nextInt();
            } {
                array[i][j] = sc.nextInt();
            } array[i][j] = sc.nextInt() array[i][j] array[i] array i j sc.nextInt() sc.nextInt sc int floor = (array[i][0] - 1) * 3 + array[i][1] - 1; floor (array[i][0] - 1) * 3 + array[i][1] - 1 (array[i][0] - 1) * 3 + array[i][1] (array[i][0] - 1) * 3 (array[i][0] - 1) array[i][0] array[i] array i 0 1 3 array[i][1] array[i] array i 1 1 int room = array[i][2] - 1; room array[i][2] - 1 array[i][2] array[i] array i 2 1 tenant[floor][room] += array[i][3] tenant[floor][room] tenant[floor] tenant floor room array[i][3] array[i] array i 3 if(tenant[floor][room] < 0){
                tenant[floor][room] = 0;
            } tenant[floor][room] < 0 tenant[floor][room] tenant[floor] tenant floor room 0 {
                tenant[floor][room] = 0;
            } tenant[floor][room] = 0 tenant[floor][room] tenant[floor] tenant floor room 0 for(int i = 0; i < 12; i++){
            if(i != 0 && i % 3 == 0){
                System.out.println("####################");
            }
            for(int j = 0; j < 10; j++){
                System.out.print(" " + tenant[i][j]);
            }
            System.out.println();
        } int i = 0; int i = 0; i 0 i < 12 i 12 i++ i++ i {
            if(i != 0 && i % 3 == 0){
                System.out.println("####################");
            }
            for(int j = 0; j < 10; j++){
                System.out.print(" " + tenant[i][j]);
            }
            System.out.println();
        } {
            if(i != 0 && i % 3 == 0){
                System.out.println("####################");
            }
            for(int j = 0; j < 10; j++){
                System.out.print(" " + tenant[i][j]);
            }
            System.out.println();
        } if(i != 0 && i % 3 == 0){
                System.out.println("####################");
            } i != 0 && i % 3 == 0 i != 0 i 0 i % 3 == 0 i % 3 i 3 0 {
                System.out.println("####################");
            } System.out.println("####################") System.out.println System.out System System.out "####################" for(int j = 0; j < 10; j++){
                System.out.print(" " + tenant[i][j]);
            } int j = 0; int j = 0; j 0 j < 10 j 10 j++ j++ j {
                System.out.print(" " + tenant[i][j]);
            } {
                System.out.print(" " + tenant[i][j]);
            } System.out.print(" " + tenant[i][j]) System.out.print System.out System System.out " " + tenant[i][j] " " tenant[i][j] tenant[i] tenant i j System.out.println() System.out.println System.out System System.out String[] args args public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int num = sc.nextInt();
        int[][] array = new int[num][4];
        int[][] tenant = new int[12][10];
        
        for(int i = 0; i < num; i++){
            for(int j = 0; j < 4; j++){
                array[i][j] = sc.nextInt();
            }
            int floor = (array[i][0] - 1) * 3 + array[i][1] - 1;
            int room = array[i][2] - 1;
            tenant[floor][room] += array[i][3];
            if(tenant[floor][room] < 0){
                tenant[floor][room] = 0;
            }
            
        }
        
        for(int i = 0; i < 12; i++){
            if(i != 0 && i % 3 == 0){
                System.out.println("####################");
            }
            for(int j = 0; j < 10; j++){
                System.out.print(" " + tenant[i][j]);
            }
            System.out.println();
        }
    }
} public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int num = sc.nextInt();
        int[][] array = new int[num][4];
        int[][] tenant = new int[12][10];
        
        for(int i = 0; i < num; i++){
            for(int j = 0; j < 4; j++){
                array[i][j] = sc.nextInt();
            }
            int floor = (array[i][0] - 1) * 3 + array[i][1] - 1;
            int room = array[i][2] - 1;
            tenant[floor][room] += array[i][3];
            if(tenant[floor][room] < 0){
                tenant[floor][room] = 0;
            }
            
        }
        
        for(int i = 0; i < 12; i++){
            if(i != 0 && i % 3 == 0){
                System.out.println("####################");
            }
            for(int j = 0; j < 10; j++){
                System.out.print(" " + tenant[i][j]);
            }
            System.out.println();
        }
    }
} Main
import java.util.Scanner;

public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int num = sc.nextInt();
        int[][] array = new int[num][4];
        int[][] tenant = new int[12][10];
        
        for(int i = 0; i < num; i++){
            for(int j = 0; j < 4; j++){
                array[i][j] = sc.nextInt();
            }
            int floor = (array[i][0] - 1) * 3 + array[i][1] - 1;
            int room = array[i][2] - 1;
            tenant[floor][room] += array[i][3];
            if(tenant[floor][room] < 0){
                tenant[floor][room] = 0;
            }
            
        }
        
        for(int i = 0; i < 12; i++){
            if(i != 0 && i % 3 == 0){
                System.out.println("####################");
            }
            for(int j = 0; j < 10; j++){
                System.out.print(" " + tenant[i][j]);
            }
            System.out.println();
        }
    }
}
