import java.util.*;
public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int N=Integer.parseInt(sc.next());
int[][][] vv=new int[4][3][10];
for(int i=0;i<N;i++){
int b=Integer.parseInt(sc.next());
int f=Integer.parseInt(sc.next());
int r=Integer.parseInt(sc.next());
int v=Integer.parseInt(sc.next());
vv[b-1][f-1][r-1]+=v;
}

for(int F=0;F<4;F++){
for(int j=0;j<3;j++){
    for(int i=0;i<10;i++){
    if(i!=9){System.out.print(" "+vv[F][j][i]);}else{System.out.println(" "+vv[F][j][i]);}
    }
if(F!=3&&j==2)System.out.println("####################");
}
}

}
} import java.util.*; util.* java public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int N=Integer.parseInt(sc.next());
int[][][] vv=new int[4][3][10];
for(int i=0;i<N;i++){
int b=Integer.parseInt(sc.next());
int f=Integer.parseInt(sc.next());
int r=Integer.parseInt(sc.next());
int v=Integer.parseInt(sc.next());
vv[b-1][f-1][r-1]+=v;
}

for(int F=0;F<4;F++){
for(int j=0;j<3;j++){
    for(int i=0;i<10;i++){
    if(i!=9){System.out.print(" "+vv[F][j][i]);}else{System.out.println(" "+vv[F][j][i]);}
    }
if(F!=3&&j==2)System.out.println("####################");
}
}

}
} Main public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int N=Integer.parseInt(sc.next());
int[][][] vv=new int[4][3][10];
for(int i=0;i<N;i++){
int b=Integer.parseInt(sc.next());
int f=Integer.parseInt(sc.next());
int r=Integer.parseInt(sc.next());
int v=Integer.parseInt(sc.next());
vv[b-1][f-1][r-1]+=v;
}

for(int F=0;F<4;F++){
for(int j=0;j<3;j++){
    for(int i=0;i<10;i++){
    if(i!=9){System.out.print(" "+vv[F][j][i]);}else{System.out.println(" "+vv[F][j][i]);}
    }
if(F!=3&&j==2)System.out.println("####################");
}
}

} main {
Scanner sc = new Scanner(System.in);
int N=Integer.parseInt(sc.next());
int[][][] vv=new int[4][3][10];
for(int i=0;i<N;i++){
int b=Integer.parseInt(sc.next());
int f=Integer.parseInt(sc.next());
int r=Integer.parseInt(sc.next());
int v=Integer.parseInt(sc.next());
vv[b-1][f-1][r-1]+=v;
}

for(int F=0;F<4;F++){
for(int j=0;j<3;j++){
    for(int i=0;i<10;i++){
    if(i!=9){System.out.print(" "+vv[F][j][i]);}else{System.out.println(" "+vv[F][j][i]);}
    }
if(F!=3&&j==2)System.out.println("####################");
}
}

} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N=Integer.parseInt(sc.next()); N Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int[][][] vv=new int[4][3][10]; vv new int[4][3][10] 4 3 10 for(int i=0;i<N;i++){
int b=Integer.parseInt(sc.next());
int f=Integer.parseInt(sc.next());
int r=Integer.parseInt(sc.next());
int v=Integer.parseInt(sc.next());
vv[b-1][f-1][r-1]+=v;
} int i=0; int i=0; i 0 i<N i N i++ i++ i {
int b=Integer.parseInt(sc.next());
int f=Integer.parseInt(sc.next());
int r=Integer.parseInt(sc.next());
int v=Integer.parseInt(sc.next());
vv[b-1][f-1][r-1]+=v;
} {
int b=Integer.parseInt(sc.next());
int f=Integer.parseInt(sc.next());
int r=Integer.parseInt(sc.next());
int v=Integer.parseInt(sc.next());
vv[b-1][f-1][r-1]+=v;
} int b=Integer.parseInt(sc.next()); b Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int f=Integer.parseInt(sc.next()); f Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int r=Integer.parseInt(sc.next()); r Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int v=Integer.parseInt(sc.next()); v Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc vv[b-1][f-1][r-1]+=v vv[b-1][f-1][r-1] vv[b-1][f-1] vv[b-1] vv b-1 b 1 f-1 f 1 r-1 r 1 v for(int F=0;F<4;F++){
for(int j=0;j<3;j++){
    for(int i=0;i<10;i++){
    if(i!=9){System.out.print(" "+vv[F][j][i]);}else{System.out.println(" "+vv[F][j][i]);}
    }
if(F!=3&&j==2)System.out.println("####################");
}
} int F=0; int F=0; F 0 F<4 F 4 F++ F++ F {
for(int j=0;j<3;j++){
    for(int i=0;i<10;i++){
    if(i!=9){System.out.print(" "+vv[F][j][i]);}else{System.out.println(" "+vv[F][j][i]);}
    }
if(F!=3&&j==2)System.out.println("####################");
}
} {
for(int j=0;j<3;j++){
    for(int i=0;i<10;i++){
    if(i!=9){System.out.print(" "+vv[F][j][i]);}else{System.out.println(" "+vv[F][j][i]);}
    }
if(F!=3&&j==2)System.out.println("####################");
}
} for(int j=0;j<3;j++){
    for(int i=0;i<10;i++){
    if(i!=9){System.out.print(" "+vv[F][j][i]);}else{System.out.println(" "+vv[F][j][i]);}
    }
if(F!=3&&j==2)System.out.println("####################");
} int j=0; int j=0; j 0 j<3 j 3 j++ j++ j {
    for(int i=0;i<10;i++){
    if(i!=9){System.out.print(" "+vv[F][j][i]);}else{System.out.println(" "+vv[F][j][i]);}
    }
if(F!=3&&j==2)System.out.println("####################");
} {
    for(int i=0;i<10;i++){
    if(i!=9){System.out.print(" "+vv[F][j][i]);}else{System.out.println(" "+vv[F][j][i]);}
    }
if(F!=3&&j==2)System.out.println("####################");
} for(int i=0;i<10;i++){
    if(i!=9){System.out.print(" "+vv[F][j][i]);}else{System.out.println(" "+vv[F][j][i]);}
    } int i=0; int i=0; i 0 i<10 i 10 i++ i++ i {
    if(i!=9){System.out.print(" "+vv[F][j][i]);}else{System.out.println(" "+vv[F][j][i]);}
    } {
    if(i!=9){System.out.print(" "+vv[F][j][i]);}else{System.out.println(" "+vv[F][j][i]);}
    } if(i!=9){System.out.print(" "+vv[F][j][i]);}else{System.out.println(" "+vv[F][j][i]);} i!=9 i 9 {System.out.print(" "+vv[F][j][i]);} System.out.print(" "+vv[F][j][i]) System.out.print System.out System System.out " "+vv[F][j][i] " " vv[F][j][i] vv[F][j] vv[F] vv F j i {System.out.println(" "+vv[F][j][i]);} System.out.println(" "+vv[F][j][i]) System.out.println System.out System System.out " "+vv[F][j][i] " " vv[F][j][i] vv[F][j] vv[F] vv F j i if(F!=3&&j==2)System.out.println("####################"); F!=3&&j==2 F!=3 F 3 j==2 j 2 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 N=Integer.parseInt(sc.next());
int[][][] vv=new int[4][3][10];
for(int i=0;i<N;i++){
int b=Integer.parseInt(sc.next());
int f=Integer.parseInt(sc.next());
int r=Integer.parseInt(sc.next());
int v=Integer.parseInt(sc.next());
vv[b-1][f-1][r-1]+=v;
}

for(int F=0;F<4;F++){
for(int j=0;j<3;j++){
    for(int i=0;i<10;i++){
    if(i!=9){System.out.print(" "+vv[F][j][i]);}else{System.out.println(" "+vv[F][j][i]);}
    }
if(F!=3&&j==2)System.out.println("####################");
}
}

}
} public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int N=Integer.parseInt(sc.next());
int[][][] vv=new int[4][3][10];
for(int i=0;i<N;i++){
int b=Integer.parseInt(sc.next());
int f=Integer.parseInt(sc.next());
int r=Integer.parseInt(sc.next());
int v=Integer.parseInt(sc.next());
vv[b-1][f-1][r-1]+=v;
}

for(int F=0;F<4;F++){
for(int j=0;j<3;j++){
    for(int i=0;i<10;i++){
    if(i!=9){System.out.print(" "+vv[F][j][i]);}else{System.out.println(" "+vv[F][j][i]);}
    }
if(F!=3&&j==2)System.out.println("####################");
}
}

}
} Main
import java.util.*;
public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int N=Integer.parseInt(sc.next());
int[][][] vv=new int[4][3][10];
for(int i=0;i<N;i++){
int b=Integer.parseInt(sc.next());
int f=Integer.parseInt(sc.next());
int r=Integer.parseInt(sc.next());
int v=Integer.parseInt(sc.next());
vv[b-1][f-1][r-1]+=v;
}

for(int F=0;F<4;F++){
for(int j=0;j<3;j++){
    for(int i=0;i<10;i++){
    if(i!=9){System.out.print(" "+vv[F][j][i]);}else{System.out.println(" "+vv[F][j][i]);}
    }
if(F!=3&&j==2)System.out.println("####################");
}
}

}
}
