import java.util.Scanner;
 
class Main{
  public static void main(String[] arg){
    int n;
    int [][][] room = new int[4][3][10];
    int b,f,r,v;

    for(int i=0; i<room.length; i++)
        for(int j=0; j<room[0].length; j++)
            for(int k=0; k<room[0][0].length; k++)
                room[i][j][k] = 0;

    Scanner in = new Scanner(System.in);

    n = in.nextInt();

    for(int i=0; i<n; i++){
        in.nextLine();
        b = in.nextInt();
        f = in.nextInt();
        r = in.nextInt();
        v = in.nextInt();

        room[b-1][f-1][r-1] += v;
    }

    for(int i=0; i<room.length; i++){
        for (int j=0; j<room[0].length; j++) {
            for(int k=0; k<room[0][0].length; k++){
                System.out.print(" " + room[i][j][k]);
            }
            System.out.println();
        }
        if(i <room.length-1)
            System.out.println("####################");
    }
  }
} import java.util.Scanner; Scanner java.util class Main{
  public static void main(String[] arg){
    int n;
    int [][][] room = new int[4][3][10];
    int b,f,r,v;

    for(int i=0; i<room.length; i++)
        for(int j=0; j<room[0].length; j++)
            for(int k=0; k<room[0][0].length; k++)
                room[i][j][k] = 0;

    Scanner in = new Scanner(System.in);

    n = in.nextInt();

    for(int i=0; i<n; i++){
        in.nextLine();
        b = in.nextInt();
        f = in.nextInt();
        r = in.nextInt();
        v = in.nextInt();

        room[b-1][f-1][r-1] += v;
    }

    for(int i=0; i<room.length; i++){
        for (int j=0; j<room[0].length; j++) {
            for(int k=0; k<room[0][0].length; k++){
                System.out.print(" " + room[i][j][k]);
            }
            System.out.println();
        }
        if(i <room.length-1)
            System.out.println("####################");
    }
  }
} Main public static void main(String[] arg){
    int n;
    int [][][] room = new int[4][3][10];
    int b,f,r,v;

    for(int i=0; i<room.length; i++)
        for(int j=0; j<room[0].length; j++)
            for(int k=0; k<room[0][0].length; k++)
                room[i][j][k] = 0;

    Scanner in = new Scanner(System.in);

    n = in.nextInt();

    for(int i=0; i<n; i++){
        in.nextLine();
        b = in.nextInt();
        f = in.nextInt();
        r = in.nextInt();
        v = in.nextInt();

        room[b-1][f-1][r-1] += v;
    }

    for(int i=0; i<room.length; i++){
        for (int j=0; j<room[0].length; j++) {
            for(int k=0; k<room[0][0].length; k++){
                System.out.print(" " + room[i][j][k]);
            }
            System.out.println();
        }
        if(i <room.length-1)
            System.out.println("####################");
    }
  } main {
    int n;
    int [][][] room = new int[4][3][10];
    int b,f,r,v;

    for(int i=0; i<room.length; i++)
        for(int j=0; j<room[0].length; j++)
            for(int k=0; k<room[0][0].length; k++)
                room[i][j][k] = 0;

    Scanner in = new Scanner(System.in);

    n = in.nextInt();

    for(int i=0; i<n; i++){
        in.nextLine();
        b = in.nextInt();
        f = in.nextInt();
        r = in.nextInt();
        v = in.nextInt();

        room[b-1][f-1][r-1] += v;
    }

    for(int i=0; i<room.length; i++){
        for (int j=0; j<room[0].length; j++) {
            for(int k=0; k<room[0][0].length; k++){
                System.out.print(" " + room[i][j][k]);
            }
            System.out.println();
        }
        if(i <room.length-1)
            System.out.println("####################");
    }
  } int n; n int [][][] room = new int[4][3][10]; room new int[4][3][10] 4 3 10 int b b f f r r v; v for(int i=0; i<room.length; i++)
        for(int j=0; j<room[0].length; j++)
            for(int k=0; k<room[0][0].length; k++)
                room[i][j][k] = 0; int i=0; int i=0; i 0 i<room.length i room.length room room.length i++ i++ i for(int j=0; j<room[0].length; j++)
            for(int k=0; k<room[0][0].length; k++)
                room[i][j][k] = 0; for(int j=0; j<room[0].length; j++)
            for(int k=0; k<room[0][0].length; k++)
                room[i][j][k] = 0; int j=0; int j=0; j 0 j<room[0].length j room[0].length room[0] room 0 room[0].length j++ j++ j for(int k=0; k<room[0][0].length; k++)
                room[i][j][k] = 0; for(int k=0; k<room[0][0].length; k++)
                room[i][j][k] = 0; int k=0; int k=0; k 0 k<room[0][0].length k room[0][0].length room[0][0] room[0] room 0 0 room[0][0].length k++ k++ k room[i][j][k] = 0; room[i][j][k] = 0 room[i][j][k] room[i][j] room[i] room i j k 0 Scanner in = new Scanner(System.in); in new Scanner(System.in) n = in.nextInt() n in.nextInt() in.nextInt in for(int i=0; i<n; i++){
        in.nextLine();
        b = in.nextInt();
        f = in.nextInt();
        r = in.nextInt();
        v = in.nextInt();

        room[b-1][f-1][r-1] += v;
    } int i=0; int i=0; i 0 i<n i n i++ i++ i {
        in.nextLine();
        b = in.nextInt();
        f = in.nextInt();
        r = in.nextInt();
        v = in.nextInt();

        room[b-1][f-1][r-1] += v;
    } {
        in.nextLine();
        b = in.nextInt();
        f = in.nextInt();
        r = in.nextInt();
        v = in.nextInt();

        room[b-1][f-1][r-1] += v;
    } in.nextLine() in.nextLine in b = in.nextInt() b in.nextInt() in.nextInt in f = in.nextInt() f in.nextInt() in.nextInt in r = in.nextInt() r in.nextInt() in.nextInt in v = in.nextInt() v in.nextInt() in.nextInt in room[b-1][f-1][r-1] += v room[b-1][f-1][r-1] room[b-1][f-1] room[b-1] room b-1 b 1 f-1 f 1 r-1 r 1 v for(int i=0; i<room.length; i++){
        for (int j=0; j<room[0].length; j++) {
            for(int k=0; k<room[0][0].length; k++){
                System.out.print(" " + room[i][j][k]);
            }
            System.out.println();
        }
        if(i <room.length-1)
            System.out.println("####################");
    } int i=0; int i=0; i 0 i<room.length i room.length room room.length i++ i++ i {
        for (int j=0; j<room[0].length; j++) {
            for(int k=0; k<room[0][0].length; k++){
                System.out.print(" " + room[i][j][k]);
            }
            System.out.println();
        }
        if(i <room.length-1)
            System.out.println("####################");
    } {
        for (int j=0; j<room[0].length; j++) {
            for(int k=0; k<room[0][0].length; k++){
                System.out.print(" " + room[i][j][k]);
            }
            System.out.println();
        }
        if(i <room.length-1)
            System.out.println("####################");
    } for (int j=0; j<room[0].length; j++) {
            for(int k=0; k<room[0][0].length; k++){
                System.out.print(" " + room[i][j][k]);
            }
            System.out.println();
        } int j=0; int j=0; j 0 j<room[0].length j room[0].length room[0] room 0 room[0].length j++ j++ j {
            for(int k=0; k<room[0][0].length; k++){
                System.out.print(" " + room[i][j][k]);
            }
            System.out.println();
        } {
            for(int k=0; k<room[0][0].length; k++){
                System.out.print(" " + room[i][j][k]);
            }
            System.out.println();
        } for(int k=0; k<room[0][0].length; k++){
                System.out.print(" " + room[i][j][k]);
            } int k=0; int k=0; k 0 k<room[0][0].length k room[0][0].length room[0][0] room[0] room 0 0 room[0][0].length k++ k++ k {
                System.out.print(" " + room[i][j][k]);
            } {
                System.out.print(" " + room[i][j][k]);
            } System.out.print(" " + room[i][j][k]) System.out.print System.out System System.out " " + room[i][j][k] " " room[i][j][k] room[i][j] room[i] room i j k System.out.println() System.out.println System.out System System.out if(i <room.length-1)
            System.out.println("####################"); i <room.length-1 i room.length-1 room.length room room.length 1 System.out.println("####################") System.out.println System.out System System.out "####################" String[] arg arg
import java.util.Scanner;
 
class Main{
  public static void main(String[] arg){
    int n;
    int [][][] room = new int[4][3][10];
    int b,f,r,v;

    for(int i=0; i<room.length; i++)
        for(int j=0; j<room[0].length; j++)
            for(int k=0; k<room[0][0].length; k++)
                room[i][j][k] = 0;

    Scanner in = new Scanner(System.in);

    n = in.nextInt();

    for(int i=0; i<n; i++){
        in.nextLine();
        b = in.nextInt();
        f = in.nextInt();
        r = in.nextInt();
        v = in.nextInt();

        room[b-1][f-1][r-1] += v;
    }

    for(int i=0; i<room.length; i++){
        for (int j=0; j<room[0].length; j++) {
            for(int k=0; k<room[0][0].length; k++){
                System.out.print(" " + room[i][j][k]);
            }
            System.out.println();
        }
        if(i <room.length-1)
            System.out.println("####################");
    }
  }
}