import java.util.Scanner;
class Main{
    int n,x,y,c;
    public void solve(){
        Scanner sc = new Scanner(System.in);
        sc.useDelimiter("\\s");
        n = sc.nextInt();
        int a[][] = new int [12][10];
        for(x = 0; x < 12; x++){
            for(y = 0; y < 10; y++){
                a[x][y] = 0;
            }
        }
        
        for(x = 0; x < n; x++){
            int b = sc.nextInt();
            int f = sc.nextInt();
            int r = sc.nextInt();
            int v = sc.nextInt();
            if(b == 1){
                a[f-1][r-1] += v;
            }else if(b == 2){
                a[f+2][r-1] += v;
            }else if(b == 3){
                a[f+5][r-1] += v;
            }else if(b == 4){
                a[f+8][r-1] += v;
            }else{
                continue;
            }
        }
        for(y = 0; y < 12; y++){
            for(c = 0; c < 10; c++){
                System.out.printf(" %d",a[y][c]);
            }
            System.out.println();      
            if(y % 3 == 2 && y != 11){
                System.out.println("####################");
            }
        }
    }
    public static void main(String[] args){
        new Main().solve();
    }
} import java.util.Scanner; Scanner java.util class Main{
    int n,x,y,c;
    public void solve(){
        Scanner sc = new Scanner(System.in);
        sc.useDelimiter("\\s");
        n = sc.nextInt();
        int a[][] = new int [12][10];
        for(x = 0; x < 12; x++){
            for(y = 0; y < 10; y++){
                a[x][y] = 0;
            }
        }
        
        for(x = 0; x < n; x++){
            int b = sc.nextInt();
            int f = sc.nextInt();
            int r = sc.nextInt();
            int v = sc.nextInt();
            if(b == 1){
                a[f-1][r-1] += v;
            }else if(b == 2){
                a[f+2][r-1] += v;
            }else if(b == 3){
                a[f+5][r-1] += v;
            }else if(b == 4){
                a[f+8][r-1] += v;
            }else{
                continue;
            }
        }
        for(y = 0; y < 12; y++){
            for(c = 0; c < 10; c++){
                System.out.printf(" %d",a[y][c]);
            }
            System.out.println();      
            if(y % 3 == 2 && y != 11){
                System.out.println("####################");
            }
        }
    }
    public static void main(String[] args){
        new Main().solve();
    }
} Main int n n x x y y c; c public void solve(){
        Scanner sc = new Scanner(System.in);
        sc.useDelimiter("\\s");
        n = sc.nextInt();
        int a[][] = new int [12][10];
        for(x = 0; x < 12; x++){
            for(y = 0; y < 10; y++){
                a[x][y] = 0;
            }
        }
        
        for(x = 0; x < n; x++){
            int b = sc.nextInt();
            int f = sc.nextInt();
            int r = sc.nextInt();
            int v = sc.nextInt();
            if(b == 1){
                a[f-1][r-1] += v;
            }else if(b == 2){
                a[f+2][r-1] += v;
            }else if(b == 3){
                a[f+5][r-1] += v;
            }else if(b == 4){
                a[f+8][r-1] += v;
            }else{
                continue;
            }
        }
        for(y = 0; y < 12; y++){
            for(c = 0; c < 10; c++){
                System.out.printf(" %d",a[y][c]);
            }
            System.out.println();      
            if(y % 3 == 2 && y != 11){
                System.out.println("####################");
            }
        }
    } solve {
        Scanner sc = new Scanner(System.in);
        sc.useDelimiter("\\s");
        n = sc.nextInt();
        int a[][] = new int [12][10];
        for(x = 0; x < 12; x++){
            for(y = 0; y < 10; y++){
                a[x][y] = 0;
            }
        }
        
        for(x = 0; x < n; x++){
            int b = sc.nextInt();
            int f = sc.nextInt();
            int r = sc.nextInt();
            int v = sc.nextInt();
            if(b == 1){
                a[f-1][r-1] += v;
            }else if(b == 2){
                a[f+2][r-1] += v;
            }else if(b == 3){
                a[f+5][r-1] += v;
            }else if(b == 4){
                a[f+8][r-1] += v;
            }else{
                continue;
            }
        }
        for(y = 0; y < 12; y++){
            for(c = 0; c < 10; c++){
                System.out.printf(" %d",a[y][c]);
            }
            System.out.println();      
            if(y % 3 == 2 && y != 11){
                System.out.println("####################");
            }
        }
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) sc.useDelimiter("\\s") sc.useDelimiter sc "\\s" n = sc.nextInt() n sc.nextInt() sc.nextInt sc int a[][] = new int [12][10]; a new int [12][10] 12 10 for(x = 0; x < 12; x++){
            for(y = 0; y < 10; y++){
                a[x][y] = 0;
            }
        } x = 0; x = 0 x 0 x < 12 x 12 x++ x++ x {
            for(y = 0; y < 10; y++){
                a[x][y] = 0;
            }
        } {
            for(y = 0; y < 10; y++){
                a[x][y] = 0;
            }
        } for(y = 0; y < 10; y++){
                a[x][y] = 0;
            } y = 0; y = 0 y 0 y < 10 y 10 y++ y++ y {
                a[x][y] = 0;
            } {
                a[x][y] = 0;
            } a[x][y] = 0 a[x][y] a[x] a x y 0 for(x = 0; x < n; x++){
            int b = sc.nextInt();
            int f = sc.nextInt();
            int r = sc.nextInt();
            int v = sc.nextInt();
            if(b == 1){
                a[f-1][r-1] += v;
            }else if(b == 2){
                a[f+2][r-1] += v;
            }else if(b == 3){
                a[f+5][r-1] += v;
            }else if(b == 4){
                a[f+8][r-1] += v;
            }else{
                continue;
            }
        } x = 0; x = 0 x 0 x < n x n x++ x++ x {
            int b = sc.nextInt();
            int f = sc.nextInt();
            int r = sc.nextInt();
            int v = sc.nextInt();
            if(b == 1){
                a[f-1][r-1] += v;
            }else if(b == 2){
                a[f+2][r-1] += v;
            }else if(b == 3){
                a[f+5][r-1] += v;
            }else if(b == 4){
                a[f+8][r-1] += v;
            }else{
                continue;
            }
        } {
            int b = sc.nextInt();
            int f = sc.nextInt();
            int r = sc.nextInt();
            int v = sc.nextInt();
            if(b == 1){
                a[f-1][r-1] += v;
            }else if(b == 2){
                a[f+2][r-1] += v;
            }else if(b == 3){
                a[f+5][r-1] += v;
            }else if(b == 4){
                a[f+8][r-1] += v;
            }else{
                continue;
            }
        } int b = sc.nextInt(); b sc.nextInt() sc.nextInt sc int f = sc.nextInt(); f sc.nextInt() sc.nextInt sc int r = sc.nextInt(); r sc.nextInt() sc.nextInt sc int v = sc.nextInt(); v sc.nextInt() sc.nextInt sc if(b == 1){
                a[f-1][r-1] += v;
            }else if(b == 2){
                a[f+2][r-1] += v;
            }else if(b == 3){
                a[f+5][r-1] += v;
            }else if(b == 4){
                a[f+8][r-1] += v;
            }else{
                continue;
            } b == 1 b 1 {
                a[f-1][r-1] += v;
            } a[f-1][r-1] += v a[f-1][r-1] a[f-1] a f-1 f 1 r-1 r 1 v if(b == 2){
                a[f+2][r-1] += v;
            }else if(b == 3){
                a[f+5][r-1] += v;
            }else if(b == 4){
                a[f+8][r-1] += v;
            }else{
                continue;
            } b == 2 b 2 {
                a[f+2][r-1] += v;
            } a[f+2][r-1] += v a[f+2][r-1] a[f+2] a f+2 f 2 r-1 r 1 v if(b == 3){
                a[f+5][r-1] += v;
            }else if(b == 4){
                a[f+8][r-1] += v;
            }else{
                continue;
            } b == 3 b 3 {
                a[f+5][r-1] += v;
            } a[f+5][r-1] += v a[f+5][r-1] a[f+5] a f+5 f 5 r-1 r 1 v if(b == 4){
                a[f+8][r-1] += v;
            }else{
                continue;
            } b == 4 b 4 {
                a[f+8][r-1] += v;
            } a[f+8][r-1] += v a[f+8][r-1] a[f+8] a f+8 f 8 r-1 r 1 v {
                continue;
            } continue; for(y = 0; y < 12; y++){
            for(c = 0; c < 10; c++){
                System.out.printf(" %d",a[y][c]);
            }
            System.out.println();      
            if(y % 3 == 2 && y != 11){
                System.out.println("####################");
            }
        } y = 0; y = 0 y 0 y < 12 y 12 y++ y++ y {
            for(c = 0; c < 10; c++){
                System.out.printf(" %d",a[y][c]);
            }
            System.out.println();      
            if(y % 3 == 2 && y != 11){
                System.out.println("####################");
            }
        } {
            for(c = 0; c < 10; c++){
                System.out.printf(" %d",a[y][c]);
            }
            System.out.println();      
            if(y % 3 == 2 && y != 11){
                System.out.println("####################");
            }
        } for(c = 0; c < 10; c++){
                System.out.printf(" %d",a[y][c]);
            } c = 0; c = 0 c 0 c < 10 c 10 c++ c++ c {
                System.out.printf(" %d",a[y][c]);
            } {
                System.out.printf(" %d",a[y][c]);
            } System.out.printf(" %d",a[y][c]) System.out.printf System.out System System.out " %d" a[y][c] a[y] a y c System.out.println() System.out.println System.out System System.out if(y % 3 == 2 && y != 11){
                System.out.println("####################");
            } y % 3 == 2 && y != 11 y % 3 == 2 y % 3 y 3 2 y != 11 y 11 {
                System.out.println("####################");
            } System.out.println("####################") System.out.println System.out System System.out "####################" public static void main(String[] args){
        new Main().solve();
    } main {
        new Main().solve();
    } new Main().solve() new Main().solve new Main() String[] args args
import java.util.Scanner;
class Main{
    int n,x,y,c;
    public void solve(){
        Scanner sc = new Scanner(System.in);
        sc.useDelimiter("\\s");
        n = sc.nextInt();
        int a[][] = new int [12][10];
        for(x = 0; x < 12; x++){
            for(y = 0; y < 10; y++){
                a[x][y] = 0;
            }
        }
        
        for(x = 0; x < n; x++){
            int b = sc.nextInt();
            int f = sc.nextInt();
            int r = sc.nextInt();
            int v = sc.nextInt();
            if(b == 1){
                a[f-1][r-1] += v;
            }else if(b == 2){
                a[f+2][r-1] += v;
            }else if(b == 3){
                a[f+5][r-1] += v;
            }else if(b == 4){
                a[f+8][r-1] += v;
            }else{
                continue;
            }
        }
        for(y = 0; y < 12; y++){
            for(c = 0; c < 10; c++){
                System.out.printf(" %d",a[y][c]);
            }
            System.out.println();      
            if(y % 3 == 2 && y != 11){
                System.out.println("####################");
            }
        }
    }
    public static void main(String[] args){
        new Main().solve();
    }
}