import java.util.Scanner;

public class Main
{
    public static void main(String[] args)
    {
        Scanner sc = new Scanner(System.in);
        int data[][][] = new int[4][3][10];
        int n,b,f,r,v;

        n = sc.nextInt();
        for(int i=0; i<n; i++)
        {
            b=sc.nextInt(); f=sc.nextInt(); r=sc.nextInt(); v=sc.nextInt();
            data[b-1][f-1][r-1]+=v;
        }

        for(int i=0; i<4; i++)
        {
            for(int k=0; k<3; k++)
            {
                for(int m=0; m<10; m++)
                {
                    System.out.printf(" %d",data[i][k][m]);
                }
                //System.out.printf("%d\n",data[i][k][9]);
                System.out.printf("\n");
            }
            if(i<3) System.out.println("####################");
        }

        sc.close();
    }
} import java.util.Scanner; Scanner java.util public class Main
{
    public static void main(String[] args)
    {
        Scanner sc = new Scanner(System.in);
        int data[][][] = new int[4][3][10];
        int n,b,f,r,v;

        n = sc.nextInt();
        for(int i=0; i<n; i++)
        {
            b=sc.nextInt(); f=sc.nextInt(); r=sc.nextInt(); v=sc.nextInt();
            data[b-1][f-1][r-1]+=v;
        }

        for(int i=0; i<4; i++)
        {
            for(int k=0; k<3; k++)
            {
                for(int m=0; m<10; m++)
                {
                    System.out.printf(" %d",data[i][k][m]);
                }
                //System.out.printf("%d\n",data[i][k][9]);
                System.out.printf("\n");
            }
            if(i<3) System.out.println("####################");
        }

        sc.close();
    }
} Main public static void main(String[] args)
    {
        Scanner sc = new Scanner(System.in);
        int data[][][] = new int[4][3][10];
        int n,b,f,r,v;

        n = sc.nextInt();
        for(int i=0; i<n; i++)
        {
            b=sc.nextInt(); f=sc.nextInt(); r=sc.nextInt(); v=sc.nextInt();
            data[b-1][f-1][r-1]+=v;
        }

        for(int i=0; i<4; i++)
        {
            for(int k=0; k<3; k++)
            {
                for(int m=0; m<10; m++)
                {
                    System.out.printf(" %d",data[i][k][m]);
                }
                //System.out.printf("%d\n",data[i][k][9]);
                System.out.printf("\n");
            }
            if(i<3) System.out.println("####################");
        }

        sc.close();
    } main {
        Scanner sc = new Scanner(System.in);
        int data[][][] = new int[4][3][10];
        int n,b,f,r,v;

        n = sc.nextInt();
        for(int i=0; i<n; i++)
        {
            b=sc.nextInt(); f=sc.nextInt(); r=sc.nextInt(); v=sc.nextInt();
            data[b-1][f-1][r-1]+=v;
        }

        for(int i=0; i<4; i++)
        {
            for(int k=0; k<3; k++)
            {
                for(int m=0; m<10; m++)
                {
                    System.out.printf(" %d",data[i][k][m]);
                }
                //System.out.printf("%d\n",data[i][k][9]);
                System.out.printf("\n");
            }
            if(i<3) System.out.println("####################");
        }

        sc.close();
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int data[][][] = new int[4][3][10]; data new int[4][3][10] 4 3 10 int n n b b f f r r v; v n = sc.nextInt() n sc.nextInt() sc.nextInt sc for(int i=0; i<n; i++)
        {
            b=sc.nextInt(); f=sc.nextInt(); r=sc.nextInt(); v=sc.nextInt();
            data[b-1][f-1][r-1]+=v;
        } int i=0; int i=0; i 0 i<n i n i++ i++ i {
            b=sc.nextInt(); f=sc.nextInt(); r=sc.nextInt(); v=sc.nextInt();
            data[b-1][f-1][r-1]+=v;
        } {
            b=sc.nextInt(); f=sc.nextInt(); r=sc.nextInt(); v=sc.nextInt();
            data[b-1][f-1][r-1]+=v;
        } b=sc.nextInt() b sc.nextInt() sc.nextInt sc f=sc.nextInt() f sc.nextInt() sc.nextInt sc r=sc.nextInt() r sc.nextInt() sc.nextInt sc v=sc.nextInt() v sc.nextInt() sc.nextInt sc data[b-1][f-1][r-1]+=v data[b-1][f-1][r-1] data[b-1][f-1] data[b-1] data b-1 b 1 f-1 f 1 r-1 r 1 v for(int i=0; i<4; i++)
        {
            for(int k=0; k<3; k++)
            {
                for(int m=0; m<10; m++)
                {
                    System.out.printf(" %d",data[i][k][m]);
                }
                //System.out.printf("%d\n",data[i][k][9]);
                System.out.printf("\n");
            }
            if(i<3) System.out.println("####################");
        } int i=0; int i=0; i 0 i<4 i 4 i++ i++ i {
            for(int k=0; k<3; k++)
            {
                for(int m=0; m<10; m++)
                {
                    System.out.printf(" %d",data[i][k][m]);
                }
                //System.out.printf("%d\n",data[i][k][9]);
                System.out.printf("\n");
            }
            if(i<3) System.out.println("####################");
        } {
            for(int k=0; k<3; k++)
            {
                for(int m=0; m<10; m++)
                {
                    System.out.printf(" %d",data[i][k][m]);
                }
                //System.out.printf("%d\n",data[i][k][9]);
                System.out.printf("\n");
            }
            if(i<3) System.out.println("####################");
        } for(int k=0; k<3; k++)
            {
                for(int m=0; m<10; m++)
                {
                    System.out.printf(" %d",data[i][k][m]);
                }
                //System.out.printf("%d\n",data[i][k][9]);
                System.out.printf("\n");
            } int k=0; int k=0; k 0 k<3 k 3 k++ k++ k {
                for(int m=0; m<10; m++)
                {
                    System.out.printf(" %d",data[i][k][m]);
                }
                //System.out.printf("%d\n",data[i][k][9]);
                System.out.printf("\n");
            } {
                for(int m=0; m<10; m++)
                {
                    System.out.printf(" %d",data[i][k][m]);
                }
                //System.out.printf("%d\n",data[i][k][9]);
                System.out.printf("\n");
            } for(int m=0; m<10; m++)
                {
                    System.out.printf(" %d",data[i][k][m]);
                } int m=0; int m=0; m 0 m<10 m 10 m++ m++ m {
                    System.out.printf(" %d",data[i][k][m]);
                } {
                    System.out.printf(" %d",data[i][k][m]);
                } System.out.printf(" %d",data[i][k][m]) System.out.printf System.out System System.out " %d" data[i][k][m] data[i][k] data[i] data i k m System.out.printf("\n") System.out.printf System.out System System.out "\n" if(i<3) System.out.println("####################"); i<3 i 3 System.out.println("####################") System.out.println System.out System System.out "####################" sc.close() sc.close sc String[] args args public class Main
{
    public static void main(String[] args)
    {
        Scanner sc = new Scanner(System.in);
        int data[][][] = new int[4][3][10];
        int n,b,f,r,v;

        n = sc.nextInt();
        for(int i=0; i<n; i++)
        {
            b=sc.nextInt(); f=sc.nextInt(); r=sc.nextInt(); v=sc.nextInt();
            data[b-1][f-1][r-1]+=v;
        }

        for(int i=0; i<4; i++)
        {
            for(int k=0; k<3; k++)
            {
                for(int m=0; m<10; m++)
                {
                    System.out.printf(" %d",data[i][k][m]);
                }
                //System.out.printf("%d\n",data[i][k][9]);
                System.out.printf("\n");
            }
            if(i<3) System.out.println("####################");
        }

        sc.close();
    }
} public class Main
{
    public static void main(String[] args)
    {
        Scanner sc = new Scanner(System.in);
        int data[][][] = new int[4][3][10];
        int n,b,f,r,v;

        n = sc.nextInt();
        for(int i=0; i<n; i++)
        {
            b=sc.nextInt(); f=sc.nextInt(); r=sc.nextInt(); v=sc.nextInt();
            data[b-1][f-1][r-1]+=v;
        }

        for(int i=0; i<4; i++)
        {
            for(int k=0; k<3; k++)
            {
                for(int m=0; m<10; m++)
                {
                    System.out.printf(" %d",data[i][k][m]);
                }
                //System.out.printf("%d\n",data[i][k][9]);
                System.out.printf("\n");
            }
            if(i<3) System.out.println("####################");
        }

        sc.close();
    }
} Main
import java.util.Scanner;

public class Main
{
    public static void main(String[] args)
    {
        Scanner sc = new Scanner(System.in);
        int data[][][] = new int[4][3][10];
        int n,b,f,r,v;

        n = sc.nextInt();
        for(int i=0; i<n; i++)
        {
            b=sc.nextInt(); f=sc.nextInt(); r=sc.nextInt(); v=sc.nextInt();
            data[b-1][f-1][r-1]+=v;
        }

        for(int i=0; i<4; i++)
        {
            for(int k=0; k<3; k++)
            {
                for(int m=0; m<10; m++)
                {
                    System.out.printf(" %d",data[i][k][m]);
                }
                //System.out.printf("%d\n",data[i][k][9]);
                System.out.printf("\n");
            }
            if(i<3) System.out.println("####################");
        }

        sc.close();
    }
}
