import java.util.Scanner;
public class Main {
	void house(){
		int house[][][] = new int[4][3][10];
		Scanner s = new Scanner(System.in);
		int cnt = s.nextInt();
		for(int i = 0;i < cnt;i++){
			int b = s.nextInt();
			int f = s.nextInt();
			int r = s.nextInt();
			int v = s.nextInt();
			house[b-1][f-1][r-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(" " + house[i][j][k]);

				}
				System.out.println("");
			}
			if(i < 3)System.out.println("####################");
		}
	}
	public static void main(String args[]){
		Main m = new Main();
		m.house();
	}
} import java.util.Scanner; Scanner java.util public class Main {
	void house(){
		int house[][][] = new int[4][3][10];
		Scanner s = new Scanner(System.in);
		int cnt = s.nextInt();
		for(int i = 0;i < cnt;i++){
			int b = s.nextInt();
			int f = s.nextInt();
			int r = s.nextInt();
			int v = s.nextInt();
			house[b-1][f-1][r-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(" " + house[i][j][k]);

				}
				System.out.println("");
			}
			if(i < 3)System.out.println("####################");
		}
	}
	public static void main(String args[]){
		Main m = new Main();
		m.house();
	}
} Main void house(){
		int house[][][] = new int[4][3][10];
		Scanner s = new Scanner(System.in);
		int cnt = s.nextInt();
		for(int i = 0;i < cnt;i++){
			int b = s.nextInt();
			int f = s.nextInt();
			int r = s.nextInt();
			int v = s.nextInt();
			house[b-1][f-1][r-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(" " + house[i][j][k]);

				}
				System.out.println("");
			}
			if(i < 3)System.out.println("####################");
		}
	} house {
		int house[][][] = new int[4][3][10];
		Scanner s = new Scanner(System.in);
		int cnt = s.nextInt();
		for(int i = 0;i < cnt;i++){
			int b = s.nextInt();
			int f = s.nextInt();
			int r = s.nextInt();
			int v = s.nextInt();
			house[b-1][f-1][r-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(" " + house[i][j][k]);

				}
				System.out.println("");
			}
			if(i < 3)System.out.println("####################");
		}
	} int house[][][] = new int[4][3][10]; house new int[4][3][10] 4 3 10 Scanner s = new Scanner(System.in); s new Scanner(System.in) int cnt = s.nextInt(); cnt s.nextInt() s.nextInt s for(int i = 0;i < cnt;i++){
			int b = s.nextInt();
			int f = s.nextInt();
			int r = s.nextInt();
			int v = s.nextInt();
			house[b-1][f-1][r-1]+=v;
		} int i = 0; int i = 0; i 0 i < cnt i cnt i++ i++ i {
			int b = s.nextInt();
			int f = s.nextInt();
			int r = s.nextInt();
			int v = s.nextInt();
			house[b-1][f-1][r-1]+=v;
		} {
			int b = s.nextInt();
			int f = s.nextInt();
			int r = s.nextInt();
			int v = s.nextInt();
			house[b-1][f-1][r-1]+=v;
		} int b = s.nextInt(); b s.nextInt() s.nextInt s int f = s.nextInt(); f s.nextInt() s.nextInt s int r = s.nextInt(); r s.nextInt() s.nextInt s int v = s.nextInt(); v s.nextInt() s.nextInt s house[b-1][f-1][r-1]+=v house[b-1][f-1][r-1] house[b-1][f-1] house[b-1] house b-1 b 1 f-1 f 1 r-1 r 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(" " + 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 static void main(String args[]){
		Main m = new Main();
		m.house();
	} main {
		Main m = new Main();
		m.house();
	} Main m = new Main(); m new Main() m.house() m.house m String args[] args public class Main {
	void house(){
		int house[][][] = new int[4][3][10];
		Scanner s = new Scanner(System.in);
		int cnt = s.nextInt();
		for(int i = 0;i < cnt;i++){
			int b = s.nextInt();
			int f = s.nextInt();
			int r = s.nextInt();
			int v = s.nextInt();
			house[b-1][f-1][r-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(" " + house[i][j][k]);

				}
				System.out.println("");
			}
			if(i < 3)System.out.println("####################");
		}
	}
	public static void main(String args[]){
		Main m = new Main();
		m.house();
	}
} public class Main {
	void house(){
		int house[][][] = new int[4][3][10];
		Scanner s = new Scanner(System.in);
		int cnt = s.nextInt();
		for(int i = 0;i < cnt;i++){
			int b = s.nextInt();
			int f = s.nextInt();
			int r = s.nextInt();
			int v = s.nextInt();
			house[b-1][f-1][r-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(" " + house[i][j][k]);

				}
				System.out.println("");
			}
			if(i < 3)System.out.println("####################");
		}
	}
	public static void main(String args[]){
		Main m = new Main();
		m.house();
	}
} Main
import java.util.Scanner;
public class Main {
	void house(){
		int house[][][] = new int[4][3][10];
		Scanner s = new Scanner(System.in);
		int cnt = s.nextInt();
		for(int i = 0;i < cnt;i++){
			int b = s.nextInt();
			int f = s.nextInt();
			int r = s.nextInt();
			int v = s.nextInt();
			house[b-1][f-1][r-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(" " + house[i][j][k]);

				}
				System.out.println("");
			}
			if(i < 3)System.out.println("####################");
		}
	}
	public static void main(String args[]){
		Main m = new Main();
		m.house();
	}
}