import java.util.*;
/*
Main class for AOJ where there is no input.
*/
public class Main{
   public static void main(String[] args){
      Scanner sc = new Scanner(System.in);
      String str;
      String[] arr;
      int n = Integer.parseInt(sc.nextLine());
      int[][][] status = new int[4][3][10];
      int building;
      int floor;
      int room;
      int v;
      
      
      //initialize "status"
      for(int i = 0; i < 4; i ++){
         for(int j = 0; j < 3; j++){
            for(int k = 0; k < 10; k ++){
               status[i][j][k] = 0;
            }
         }
      }
      
      for(int i = 0; i < n; i ++){
         str = sc.nextLine();
         arr = str.split(" ");
         building = Integer.parseInt(arr[0]);
         floor = Integer.parseInt(arr[1]);
         room = Integer.parseInt(arr[2]);
         v = Integer.parseInt(arr[3]);
         
         status[building-1][floor-1][room-1] += v;
      }
      
      for(int i = 0; i < 4; i ++){
         for(int j = 0; j < 3; j++){
            for(int k = 0; k < 10; k ++){
               System.out.print(" " + status[i][j][k]);
            }
            System.out.println();
         }
         if(i < 3) {
            System.out.println("####################");
         }
      }
   
   }//main
}//class import java.util.*; util.* java public class Main{
   public static void main(String[] args){
      Scanner sc = new Scanner(System.in);
      String str;
      String[] arr;
      int n = Integer.parseInt(sc.nextLine());
      int[][][] status = new int[4][3][10];
      int building;
      int floor;
      int room;
      int v;
      
      
      //initialize "status"
      for(int i = 0; i < 4; i ++){
         for(int j = 0; j < 3; j++){
            for(int k = 0; k < 10; k ++){
               status[i][j][k] = 0;
            }
         }
      }
      
      for(int i = 0; i < n; i ++){
         str = sc.nextLine();
         arr = str.split(" ");
         building = Integer.parseInt(arr[0]);
         floor = Integer.parseInt(arr[1]);
         room = Integer.parseInt(arr[2]);
         v = Integer.parseInt(arr[3]);
         
         status[building-1][floor-1][room-1] += v;
      }
      
      for(int i = 0; i < 4; i ++){
         for(int j = 0; j < 3; j++){
            for(int k = 0; k < 10; k ++){
               System.out.print(" " + status[i][j][k]);
            }
            System.out.println();
         }
         if(i < 3) {
            System.out.println("####################");
         }
      }
   
   }//main
}//class Main public static void main(String[] args){
      Scanner sc = new Scanner(System.in);
      String str;
      String[] arr;
      int n = Integer.parseInt(sc.nextLine());
      int[][][] status = new int[4][3][10];
      int building;
      int floor;
      int room;
      int v;
      
      
      //initialize "status"
      for(int i = 0; i < 4; i ++){
         for(int j = 0; j < 3; j++){
            for(int k = 0; k < 10; k ++){
               status[i][j][k] = 0;
            }
         }
      }
      
      for(int i = 0; i < n; i ++){
         str = sc.nextLine();
         arr = str.split(" ");
         building = Integer.parseInt(arr[0]);
         floor = Integer.parseInt(arr[1]);
         room = Integer.parseInt(arr[2]);
         v = Integer.parseInt(arr[3]);
         
         status[building-1][floor-1][room-1] += v;
      }
      
      for(int i = 0; i < 4; i ++){
         for(int j = 0; j < 3; j++){
            for(int k = 0; k < 10; k ++){
               System.out.print(" " + status[i][j][k]);
            }
            System.out.println();
         }
         if(i < 3) {
            System.out.println("####################");
         }
      }
   
   }//main main {
      Scanner sc = new Scanner(System.in);
      String str;
      String[] arr;
      int n = Integer.parseInt(sc.nextLine());
      int[][][] status = new int[4][3][10];
      int building;
      int floor;
      int room;
      int v;
      
      
      //initialize "status"
      for(int i = 0; i < 4; i ++){
         for(int j = 0; j < 3; j++){
            for(int k = 0; k < 10; k ++){
               status[i][j][k] = 0;
            }
         }
      }
      
      for(int i = 0; i < n; i ++){
         str = sc.nextLine();
         arr = str.split(" ");
         building = Integer.parseInt(arr[0]);
         floor = Integer.parseInt(arr[1]);
         room = Integer.parseInt(arr[2]);
         v = Integer.parseInt(arr[3]);
         
         status[building-1][floor-1][room-1] += v;
      }
      
      for(int i = 0; i < 4; i ++){
         for(int j = 0; j < 3; j++){
            for(int k = 0; k < 10; k ++){
               System.out.print(" " + status[i][j][k]);
            }
            System.out.println();
         }
         if(i < 3) {
            System.out.println("####################");
         }
      }
   
   } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String str; str String[] arr; arr int n = Integer.parseInt(sc.nextLine()); n Integer.parseInt(sc.nextLine()) Integer.parseInt Integer sc.nextLine() sc.nextLine sc int[][][] status = new int[4][3][10]; status new int[4][3][10] 4 3 10 int building; building int floor; floor int room; room int v; v for(int i = 0; i < 4; i ++){
         for(int j = 0; j < 3; j++){
            for(int k = 0; k < 10; k ++){
               status[i][j][k] = 0;
            }
         }
      } 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 ++){
               status[i][j][k] = 0;
            }
         }
      } {
         for(int j = 0; j < 3; j++){
            for(int k = 0; k < 10; k ++){
               status[i][j][k] = 0;
            }
         }
      } for(int j = 0; j < 3; j++){
            for(int k = 0; k < 10; k ++){
               status[i][j][k] = 0;
            }
         } int j = 0; int j = 0; j 0 j < 3 j 3 j++ j++ j {
            for(int k = 0; k < 10; k ++){
               status[i][j][k] = 0;
            }
         } {
            for(int k = 0; k < 10; k ++){
               status[i][j][k] = 0;
            }
         } for(int k = 0; k < 10; k ++){
               status[i][j][k] = 0;
            } int k = 0; int k = 0; k 0 k < 10 k 10 k ++ k ++ k {
               status[i][j][k] = 0;
            } {
               status[i][j][k] = 0;
            } status[i][j][k] = 0 status[i][j][k] status[i][j] status[i] status i j k 0 for(int i = 0; i < n; i ++){
         str = sc.nextLine();
         arr = str.split(" ");
         building = Integer.parseInt(arr[0]);
         floor = Integer.parseInt(arr[1]);
         room = Integer.parseInt(arr[2]);
         v = Integer.parseInt(arr[3]);
         
         status[building-1][floor-1][room-1] += v;
      } int i = 0; int i = 0; i 0 i < n i n i ++ i ++ i {
         str = sc.nextLine();
         arr = str.split(" ");
         building = Integer.parseInt(arr[0]);
         floor = Integer.parseInt(arr[1]);
         room = Integer.parseInt(arr[2]);
         v = Integer.parseInt(arr[3]);
         
         status[building-1][floor-1][room-1] += v;
      } {
         str = sc.nextLine();
         arr = str.split(" ");
         building = Integer.parseInt(arr[0]);
         floor = Integer.parseInt(arr[1]);
         room = Integer.parseInt(arr[2]);
         v = Integer.parseInt(arr[3]);
         
         status[building-1][floor-1][room-1] += v;
      } str = sc.nextLine() str sc.nextLine() sc.nextLine sc arr = str.split(" ") arr str.split(" ") str.split str " " building = Integer.parseInt(arr[0]) building Integer.parseInt(arr[0]) Integer.parseInt Integer arr[0] arr 0 floor = Integer.parseInt(arr[1]) floor Integer.parseInt(arr[1]) Integer.parseInt Integer arr[1] arr 1 room = Integer.parseInt(arr[2]) room Integer.parseInt(arr[2]) Integer.parseInt Integer arr[2] arr 2 v = Integer.parseInt(arr[3]) v Integer.parseInt(arr[3]) Integer.parseInt Integer arr[3] arr 3 status[building-1][floor-1][room-1] += v status[building-1][floor-1][room-1] status[building-1][floor-1] status[building-1] status building-1 building 1 floor-1 floor 1 room-1 room 1 v for(int i = 0; i < 4; i ++){
         for(int j = 0; j < 3; j++){
            for(int k = 0; k < 10; k ++){
               System.out.print(" " + status[i][j][k]);
            }
            System.out.println();
         }
         if(i < 3) {
            System.out.println("####################");
         }
      } 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.print(" " + status[i][j][k]);
            }
            System.out.println();
         }
         if(i < 3) {
            System.out.println("####################");
         }
      } {
         for(int j = 0; j < 3; j++){
            for(int k = 0; k < 10; k ++){
               System.out.print(" " + status[i][j][k]);
            }
            System.out.println();
         }
         if(i < 3) {
            System.out.println("####################");
         }
      } for(int j = 0; j < 3; j++){
            for(int k = 0; k < 10; k ++){
               System.out.print(" " + status[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.print(" " + status[i][j][k]);
            }
            System.out.println();
         } {
            for(int k = 0; k < 10; k ++){
               System.out.print(" " + status[i][j][k]);
            }
            System.out.println();
         } for(int k = 0; k < 10; k ++){
               System.out.print(" " + status[i][j][k]);
            } int k = 0; int k = 0; k 0 k < 10 k 10 k ++ k ++ k {
               System.out.print(" " + status[i][j][k]);
            } {
               System.out.print(" " + status[i][j][k]);
            } System.out.print(" " + status[i][j][k]) System.out.print System.out System System.out " " + status[i][j][k] " " status[i][j][k] status[i][j] status[i] status i j k System.out.println() System.out.println System.out System System.out if(i < 3) {
            System.out.println("####################");
         } i < 3 i 3 {
            System.out.println("####################");
         } 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);
      String str;
      String[] arr;
      int n = Integer.parseInt(sc.nextLine());
      int[][][] status = new int[4][3][10];
      int building;
      int floor;
      int room;
      int v;
      
      
      //initialize "status"
      for(int i = 0; i < 4; i ++){
         for(int j = 0; j < 3; j++){
            for(int k = 0; k < 10; k ++){
               status[i][j][k] = 0;
            }
         }
      }
      
      for(int i = 0; i < n; i ++){
         str = sc.nextLine();
         arr = str.split(" ");
         building = Integer.parseInt(arr[0]);
         floor = Integer.parseInt(arr[1]);
         room = Integer.parseInt(arr[2]);
         v = Integer.parseInt(arr[3]);
         
         status[building-1][floor-1][room-1] += v;
      }
      
      for(int i = 0; i < 4; i ++){
         for(int j = 0; j < 3; j++){
            for(int k = 0; k < 10; k ++){
               System.out.print(" " + status[i][j][k]);
            }
            System.out.println();
         }
         if(i < 3) {
            System.out.println("####################");
         }
      }
   
   }//main
}//class public class Main{
   public static void main(String[] args){
      Scanner sc = new Scanner(System.in);
      String str;
      String[] arr;
      int n = Integer.parseInt(sc.nextLine());
      int[][][] status = new int[4][3][10];
      int building;
      int floor;
      int room;
      int v;
      
      
      //initialize "status"
      for(int i = 0; i < 4; i ++){
         for(int j = 0; j < 3; j++){
            for(int k = 0; k < 10; k ++){
               status[i][j][k] = 0;
            }
         }
      }
      
      for(int i = 0; i < n; i ++){
         str = sc.nextLine();
         arr = str.split(" ");
         building = Integer.parseInt(arr[0]);
         floor = Integer.parseInt(arr[1]);
         room = Integer.parseInt(arr[2]);
         v = Integer.parseInt(arr[3]);
         
         status[building-1][floor-1][room-1] += v;
      }
      
      for(int i = 0; i < 4; i ++){
         for(int j = 0; j < 3; j++){
            for(int k = 0; k < 10; k ++){
               System.out.print(" " + status[i][j][k]);
            }
            System.out.println();
         }
         if(i < 3) {
            System.out.println("####################");
         }
      }
   
   }//main
}//class Main
import java.util.*;
/*
Main class for AOJ where there is no input.
*/
public class Main{
   public static void main(String[] args){
      Scanner sc = new Scanner(System.in);
      String str;
      String[] arr;
      int n = Integer.parseInt(sc.nextLine());
      int[][][] status = new int[4][3][10];
      int building;
      int floor;
      int room;
      int v;
      
      
      //initialize "status"
      for(int i = 0; i < 4; i ++){
         for(int j = 0; j < 3; j++){
            for(int k = 0; k < 10; k ++){
               status[i][j][k] = 0;
            }
         }
      }
      
      for(int i = 0; i < n; i ++){
         str = sc.nextLine();
         arr = str.split(" ");
         building = Integer.parseInt(arr[0]);
         floor = Integer.parseInt(arr[1]);
         room = Integer.parseInt(arr[2]);
         v = Integer.parseInt(arr[3]);
         
         status[building-1][floor-1][room-1] += v;
      }
      
      for(int i = 0; i < 4; i ++){
         for(int j = 0; j < 3; j++){
            for(int k = 0; k < 10; k ++){
               System.out.print(" " + status[i][j][k]);
            }
            System.out.println();
         }
         if(i < 3) {
            System.out.println("####################");
         }
      }
   
   }//main
}//class