// ITP1_6_C OfficialHouse
import java.io.*;

public class Main {
   static int[][][] count = new int[4][3][10];
   static int b,f,r,v;

   public static void main(String[] args) {
      try  {
         BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
         int n = Integer.parseInt(br.readLine());
         for (int i = 0; i < n; i++) {
            String[] array = (br.readLine()).split(" ");
            b = Integer.parseInt(array[0]) - 1;
            f = Integer.parseInt(array[1]) - 1;
            r = Integer.parseInt(array[2]) - 1;
            v = Integer.parseInt(array[3]);

            count[b][f][r] += v;
         }

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

      catch (Exception e) {
         System.out.println(e);
      }
   }
} import java.io.*; io.* java public class Main {
   static int[][][] count = new int[4][3][10];
   static int b,f,r,v;

   public static void main(String[] args) {
      try  {
         BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
         int n = Integer.parseInt(br.readLine());
         for (int i = 0; i < n; i++) {
            String[] array = (br.readLine()).split(" ");
            b = Integer.parseInt(array[0]) - 1;
            f = Integer.parseInt(array[1]) - 1;
            r = Integer.parseInt(array[2]) - 1;
            v = Integer.parseInt(array[3]);

            count[b][f][r] += v;
         }

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

      catch (Exception e) {
         System.out.println(e);
      }
   }
} Main static int[][][] count = new int[4][3][10]; count new int[4][3][10] 4 3 10 static int b b f f r r v; v public static void main(String[] args) {
      try  {
         BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
         int n = Integer.parseInt(br.readLine());
         for (int i = 0; i < n; i++) {
            String[] array = (br.readLine()).split(" ");
            b = Integer.parseInt(array[0]) - 1;
            f = Integer.parseInt(array[1]) - 1;
            r = Integer.parseInt(array[2]) - 1;
            v = Integer.parseInt(array[3]);

            count[b][f][r] += v;
         }

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

      catch (Exception e) {
         System.out.println(e);
      }
   } main {
      try  {
         BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
         int n = Integer.parseInt(br.readLine());
         for (int i = 0; i < n; i++) {
            String[] array = (br.readLine()).split(" ");
            b = Integer.parseInt(array[0]) - 1;
            f = Integer.parseInt(array[1]) - 1;
            r = Integer.parseInt(array[2]) - 1;
            v = Integer.parseInt(array[3]);

            count[b][f][r] += v;
         }

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

      catch (Exception e) {
         System.out.println(e);
      }
   } try  {
         BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
         int n = Integer.parseInt(br.readLine());
         for (int i = 0; i < n; i++) {
            String[] array = (br.readLine()).split(" ");
            b = Integer.parseInt(array[0]) - 1;
            f = Integer.parseInt(array[1]) - 1;
            r = Integer.parseInt(array[2]) - 1;
            v = Integer.parseInt(array[3]);

            count[b][f][r] += v;
         }

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

      catch (Exception e) {
         System.out.println(e);
      } catch (Exception e) {
         System.out.println(e);
      } Exception e {
         System.out.println(e);
      } System.out.println(e) System.out.println System.out System System.out e {
         BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
         int n = Integer.parseInt(br.readLine());
         for (int i = 0; i < n; i++) {
            String[] array = (br.readLine()).split(" ");
            b = Integer.parseInt(array[0]) - 1;
            f = Integer.parseInt(array[1]) - 1;
            r = Integer.parseInt(array[2]) - 1;
            v = Integer.parseInt(array[3]);

            count[b][f][r] += v;
         }

         for (int i = 0; i < 4; i++) {
            for (int j = 0; j < 3; j++) {
               for (int k = 0; k < 10; k++) {
                  System.out.printf(" %d", count[i][j][k]);
               }
               System.out.println();
            }
            if (i < 3)
               System.out.printf("####################\n");
         }
      } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) int n = Integer.parseInt(br.readLine()); n Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br for (int i = 0; i < n; i++) {
            String[] array = (br.readLine()).split(" ");
            b = Integer.parseInt(array[0]) - 1;
            f = Integer.parseInt(array[1]) - 1;
            r = Integer.parseInt(array[2]) - 1;
            v = Integer.parseInt(array[3]);

            count[b][f][r] += v;
         } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            String[] array = (br.readLine()).split(" ");
            b = Integer.parseInt(array[0]) - 1;
            f = Integer.parseInt(array[1]) - 1;
            r = Integer.parseInt(array[2]) - 1;
            v = Integer.parseInt(array[3]);

            count[b][f][r] += v;
         } {
            String[] array = (br.readLine()).split(" ");
            b = Integer.parseInt(array[0]) - 1;
            f = Integer.parseInt(array[1]) - 1;
            r = Integer.parseInt(array[2]) - 1;
            v = Integer.parseInt(array[3]);

            count[b][f][r] += v;
         } String[] array = (br.readLine()).split(" "); array (br.readLine()).split(" ") (br.readLine()).split (br.readLine()) br.readLine br " " b = Integer.parseInt(array[0]) - 1 b Integer.parseInt(array[0]) - 1 Integer.parseInt(array[0]) Integer.parseInt Integer array[0] array 0 1 f = Integer.parseInt(array[1]) - 1 f Integer.parseInt(array[1]) - 1 Integer.parseInt(array[1]) Integer.parseInt Integer array[1] array 1 1 r = Integer.parseInt(array[2]) - 1 r Integer.parseInt(array[2]) - 1 Integer.parseInt(array[2]) Integer.parseInt Integer array[2] array 2 1 v = Integer.parseInt(array[3]) v Integer.parseInt(array[3]) Integer.parseInt Integer array[3] array 3 count[b][f][r] += v count[b][f][r] count[b][f] count[b] count b f r v for (int i = 0; i < 4; i++) {
            for (int j = 0; j < 3; j++) {
               for (int k = 0; k < 10; k++) {
                  System.out.printf(" %d", count[i][j][k]);
               }
               System.out.println();
            }
            if (i < 3)
               System.out.printf("####################\n");
         } int i = 0; int i = 0; i 0 i < 4 i 4 i++ i++ i {
            for (int j = 0; j < 3; j++) {
               for (int k = 0; k < 10; k++) {
                  System.out.printf(" %d", count[i][j][k]);
               }
               System.out.println();
            }
            if (i < 3)
               System.out.printf("####################\n");
         } {
            for (int j = 0; j < 3; j++) {
               for (int k = 0; k < 10; k++) {
                  System.out.printf(" %d", count[i][j][k]);
               }
               System.out.println();
            }
            if (i < 3)
               System.out.printf("####################\n");
         } for (int j = 0; j < 3; j++) {
               for (int k = 0; k < 10; k++) {
                  System.out.printf(" %d", count[i][j][k]);
               }
               System.out.println();
            } int j = 0; int j = 0; j 0 j < 3 j 3 j++ j++ j {
               for (int k = 0; k < 10; k++) {
                  System.out.printf(" %d", count[i][j][k]);
               }
               System.out.println();
            } {
               for (int k = 0; k < 10; k++) {
                  System.out.printf(" %d", count[i][j][k]);
               }
               System.out.println();
            } for (int k = 0; k < 10; k++) {
                  System.out.printf(" %d", count[i][j][k]);
               } int k = 0; int k = 0; k 0 k < 10 k 10 k++ k++ k {
                  System.out.printf(" %d", count[i][j][k]);
               } {
                  System.out.printf(" %d", count[i][j][k]);
               } System.out.printf(" %d", count[i][j][k]) System.out.printf System.out System System.out " %d" count[i][j][k] count[i][j] count[i] count i j k System.out.println() System.out.println System.out System System.out if (i < 3)
               System.out.printf("####################\n"); i < 3 i 3 System.out.printf("####################\n") System.out.printf System.out System System.out "####################\n" String[] args args public class Main {
   static int[][][] count = new int[4][3][10];
   static int b,f,r,v;

   public static void main(String[] args) {
      try  {
         BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
         int n = Integer.parseInt(br.readLine());
         for (int i = 0; i < n; i++) {
            String[] array = (br.readLine()).split(" ");
            b = Integer.parseInt(array[0]) - 1;
            f = Integer.parseInt(array[1]) - 1;
            r = Integer.parseInt(array[2]) - 1;
            v = Integer.parseInt(array[3]);

            count[b][f][r] += v;
         }

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

      catch (Exception e) {
         System.out.println(e);
      }
   }
} public class Main {
   static int[][][] count = new int[4][3][10];
   static int b,f,r,v;

   public static void main(String[] args) {
      try  {
         BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
         int n = Integer.parseInt(br.readLine());
         for (int i = 0; i < n; i++) {
            String[] array = (br.readLine()).split(" ");
            b = Integer.parseInt(array[0]) - 1;
            f = Integer.parseInt(array[1]) - 1;
            r = Integer.parseInt(array[2]) - 1;
            v = Integer.parseInt(array[3]);

            count[b][f][r] += v;
         }

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

      catch (Exception e) {
         System.out.println(e);
      }
   }
} Main
// ITP1_6_C OfficialHouse
import java.io.*;

public class Main {
   static int[][][] count = new int[4][3][10];
   static int b,f,r,v;

   public static void main(String[] args) {
      try  {
         BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
         int n = Integer.parseInt(br.readLine());
         for (int i = 0; i < n; i++) {
            String[] array = (br.readLine()).split(" ");
            b = Integer.parseInt(array[0]) - 1;
            f = Integer.parseInt(array[1]) - 1;
            r = Integer.parseInt(array[2]) - 1;
            v = Integer.parseInt(array[3]);

            count[b][f][r] += v;
         }

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

      catch (Exception e) {
         System.out.println(e);
      }
   }
}