import java.util.*;
  
public class Main {
    Scanner sc = new Scanner(System.in);
  
    public static void main(String[] args) {
        new Main(); 
    }
  
    public Main() {
        new TEST().doIt();
    }
    class TEST{
        void doIt(){
        	int n = sc.nextInt() + 1;
        	int house[][][] = new int [4][3][10];
        	for(int i = 0;i < n-1;i++){
        		int t = sc.nextInt()-1;
        		int h = sc.nextInt()-1;
        		int w = sc.nextInt()-1;
        		int num = sc.nextInt();
        		house[t][h][w] = house[t][h][w] + num;
        		if(house[t][h][w] < 0)house[t][h][w] = 0;
        	}
        	for(int i = 0;i < 4;i++){
        		for(int j = 0;j < 3;j++){
        			for(int k = 0;k < 10;k++){
        				System.out.print(" "+house[i][j][k]);
        			}
        			System.out.println();
        		}
        		if(i != 3)System.out.println("####################");
        	}
        }
    }
} import java.util.*; util.* java public class Main {
    Scanner sc = new Scanner(System.in);
  
    public static void main(String[] args) {
        new Main(); 
    }
  
    public Main() {
        new TEST().doIt();
    }
    class TEST{
        void doIt(){
        	int n = sc.nextInt() + 1;
        	int house[][][] = new int [4][3][10];
        	for(int i = 0;i < n-1;i++){
        		int t = sc.nextInt()-1;
        		int h = sc.nextInt()-1;
        		int w = sc.nextInt()-1;
        		int num = sc.nextInt();
        		house[t][h][w] = house[t][h][w] + num;
        		if(house[t][h][w] < 0)house[t][h][w] = 0;
        	}
        	for(int i = 0;i < 4;i++){
        		for(int j = 0;j < 3;j++){
        			for(int k = 0;k < 10;k++){
        				System.out.print(" "+house[i][j][k]);
        			}
        			System.out.println();
        		}
        		if(i != 3)System.out.println("####################");
        	}
        }
    }
} Main Scanner sc = new Scanner(System.in); sc new Scanner(System.in) public static void main(String[] args) {
        new Main(); 
    } main {
        new Main(); 
    } new Main() String[] args args public Main() {
        new TEST().doIt();
    } Main {
        new TEST().doIt();
    } new TEST().doIt() new TEST().doIt new TEST() class TEST{
        void doIt(){
        	int n = sc.nextInt() + 1;
        	int house[][][] = new int [4][3][10];
        	for(int i = 0;i < n-1;i++){
        		int t = sc.nextInt()-1;
        		int h = sc.nextInt()-1;
        		int w = sc.nextInt()-1;
        		int num = sc.nextInt();
        		house[t][h][w] = house[t][h][w] + num;
        		if(house[t][h][w] < 0)house[t][h][w] = 0;
        	}
        	for(int i = 0;i < 4;i++){
        		for(int j = 0;j < 3;j++){
        			for(int k = 0;k < 10;k++){
        				System.out.print(" "+house[i][j][k]);
        			}
        			System.out.println();
        		}
        		if(i != 3)System.out.println("####################");
        	}
        }
    } TEST void doIt(){
        	int n = sc.nextInt() + 1;
        	int house[][][] = new int [4][3][10];
        	for(int i = 0;i < n-1;i++){
        		int t = sc.nextInt()-1;
        		int h = sc.nextInt()-1;
        		int w = sc.nextInt()-1;
        		int num = sc.nextInt();
        		house[t][h][w] = house[t][h][w] + num;
        		if(house[t][h][w] < 0)house[t][h][w] = 0;
        	}
        	for(int i = 0;i < 4;i++){
        		for(int j = 0;j < 3;j++){
        			for(int k = 0;k < 10;k++){
        				System.out.print(" "+house[i][j][k]);
        			}
        			System.out.println();
        		}
        		if(i != 3)System.out.println("####################");
        	}
        } doIt {
        	int n = sc.nextInt() + 1;
        	int house[][][] = new int [4][3][10];
        	for(int i = 0;i < n-1;i++){
        		int t = sc.nextInt()-1;
        		int h = sc.nextInt()-1;
        		int w = sc.nextInt()-1;
        		int num = sc.nextInt();
        		house[t][h][w] = house[t][h][w] + num;
        		if(house[t][h][w] < 0)house[t][h][w] = 0;
        	}
        	for(int i = 0;i < 4;i++){
        		for(int j = 0;j < 3;j++){
        			for(int k = 0;k < 10;k++){
        				System.out.print(" "+house[i][j][k]);
        			}
        			System.out.println();
        		}
        		if(i != 3)System.out.println("####################");
        	}
        } int n = sc.nextInt() + 1; n sc.nextInt() + 1 sc.nextInt() sc.nextInt sc 1 int house[][][] = new int [4][3][10]; house new int [4][3][10] 4 3 10 for(int i = 0;i < n-1;i++){
        		int t = sc.nextInt()-1;
        		int h = sc.nextInt()-1;
        		int w = sc.nextInt()-1;
        		int num = sc.nextInt();
        		house[t][h][w] = house[t][h][w] + num;
        		if(house[t][h][w] < 0)house[t][h][w] = 0;
        	} int i = 0; int i = 0; i 0 i < n-1 i n-1 n 1 i++ i++ i {
        		int t = sc.nextInt()-1;
        		int h = sc.nextInt()-1;
        		int w = sc.nextInt()-1;
        		int num = sc.nextInt();
        		house[t][h][w] = house[t][h][w] + num;
        		if(house[t][h][w] < 0)house[t][h][w] = 0;
        	} {
        		int t = sc.nextInt()-1;
        		int h = sc.nextInt()-1;
        		int w = sc.nextInt()-1;
        		int num = sc.nextInt();
        		house[t][h][w] = house[t][h][w] + num;
        		if(house[t][h][w] < 0)house[t][h][w] = 0;
        	} int t = sc.nextInt()-1; t sc.nextInt()-1 sc.nextInt() sc.nextInt sc 1 int h = sc.nextInt()-1; h sc.nextInt()-1 sc.nextInt() sc.nextInt sc 1 int w = sc.nextInt()-1; w sc.nextInt()-1 sc.nextInt() sc.nextInt sc 1 int num = sc.nextInt(); num sc.nextInt() sc.nextInt sc house[t][h][w] = house[t][h][w] + num house[t][h][w] house[t][h] house[t] house t h w house[t][h][w] + num house[t][h][w] house[t][h] house[t] house t h w num if(house[t][h][w] < 0)house[t][h][w] = 0; house[t][h][w] < 0 house[t][h][w] house[t][h] house[t] house t h w 0 house[t][h][w] = 0 house[t][h][w] house[t][h] house[t] house t h w 0 for(int i = 0;i < 4;i++){
        		for(int j = 0;j < 3;j++){
        			for(int k = 0;k < 10;k++){
        				System.out.print(" "+house[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(" "+house[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(" "+house[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(" "+house[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(" "+house[i][j][k]);
        			}
        			System.out.println();
        		} {
        			for(int k = 0;k < 10;k++){
        				System.out.print(" "+house[i][j][k]);
        			}
        			System.out.println();
        		} for(int k = 0;k < 10;k++){
        				System.out.print(" "+house[i][j][k]);
        			} int k = 0; int k = 0; k 0 k < 10 k 10 k++ k++ k {
        				System.out.print(" "+house[i][j][k]);
        			} {
        				System.out.print(" "+house[i][j][k]);
        			} System.out.print(" "+house[i][j][k]) System.out.print System.out System System.out " "+house[i][j][k] " " house[i][j][k] house[i][j] house[i] house 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 System System.out "####################" public class Main {
    Scanner sc = new Scanner(System.in);
  
    public static void main(String[] args) {
        new Main(); 
    }
  
    public Main() {
        new TEST().doIt();
    }
    class TEST{
        void doIt(){
        	int n = sc.nextInt() + 1;
        	int house[][][] = new int [4][3][10];
        	for(int i = 0;i < n-1;i++){
        		int t = sc.nextInt()-1;
        		int h = sc.nextInt()-1;
        		int w = sc.nextInt()-1;
        		int num = sc.nextInt();
        		house[t][h][w] = house[t][h][w] + num;
        		if(house[t][h][w] < 0)house[t][h][w] = 0;
        	}
        	for(int i = 0;i < 4;i++){
        		for(int j = 0;j < 3;j++){
        			for(int k = 0;k < 10;k++){
        				System.out.print(" "+house[i][j][k]);
        			}
        			System.out.println();
        		}
        		if(i != 3)System.out.println("####################");
        	}
        }
    }
} public class Main {
    Scanner sc = new Scanner(System.in);
  
    public static void main(String[] args) {
        new Main(); 
    }
  
    public Main() {
        new TEST().doIt();
    }
    class TEST{
        void doIt(){
        	int n = sc.nextInt() + 1;
        	int house[][][] = new int [4][3][10];
        	for(int i = 0;i < n-1;i++){
        		int t = sc.nextInt()-1;
        		int h = sc.nextInt()-1;
        		int w = sc.nextInt()-1;
        		int num = sc.nextInt();
        		house[t][h][w] = house[t][h][w] + num;
        		if(house[t][h][w] < 0)house[t][h][w] = 0;
        	}
        	for(int i = 0;i < 4;i++){
        		for(int j = 0;j < 3;j++){
        			for(int k = 0;k < 10;k++){
        				System.out.print(" "+house[i][j][k]);
        			}
        			System.out.println();
        		}
        		if(i != 3)System.out.println("####################");
        	}
        }
    }
} Main
import java.util.*;
  
public class Main {
    Scanner sc = new Scanner(System.in);
  
    public static void main(String[] args) {
        new Main(); 
    }
  
    public Main() {
        new TEST().doIt();
    }
    class TEST{
        void doIt(){
        	int n = sc.nextInt() + 1;
        	int house[][][] = new int [4][3][10];
        	for(int i = 0;i < n-1;i++){
        		int t = sc.nextInt()-1;
        		int h = sc.nextInt()-1;
        		int w = sc.nextInt()-1;
        		int num = sc.nextInt();
        		house[t][h][w] = house[t][h][w] + num;
        		if(house[t][h][w] < 0)house[t][h][w] = 0;
        	}
        	for(int i = 0;i < 4;i++){
        		for(int j = 0;j < 3;j++){
        			for(int k = 0;k < 10;k++){
        				System.out.print(" "+house[i][j][k]);
        			}
        			System.out.println();
        		}
        		if(i != 3)System.out.println("####################");
        	}
        }
    }
}