import java.util.Scanner;

public class Main{

	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int[][][] BigHouse=new int[4][3][10];
		for(int i=0;i<4;i++){
			for(int j=0;j<3;j++){
				for(int k=0;k<10;k++){
					BigHouse[i][j][k]=0;
				}
			}
		}

		int order=sc.nextInt();
		for(int i=0;i<order;i++){
			int b=sc.nextInt()-1;
			int f=sc.nextInt()-1;
			int r=sc.nextInt()-1;
			int v=sc.nextInt();
			BigHouse[b][f][r]+=v;
			if(BigHouse[b][f][r]<0){
				BigHouse[b][f][r]=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(" "+BigHouse[i][j][k]);
				}
				System.out.println();
			}
			if(i!=3){
				System.out.println("####################");
			}
		}
	}

}
 import java.util.Scanner; Scanner java.util public class Main{

	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int[][][] BigHouse=new int[4][3][10];
		for(int i=0;i<4;i++){
			for(int j=0;j<3;j++){
				for(int k=0;k<10;k++){
					BigHouse[i][j][k]=0;
				}
			}
		}

		int order=sc.nextInt();
		for(int i=0;i<order;i++){
			int b=sc.nextInt()-1;
			int f=sc.nextInt()-1;
			int r=sc.nextInt()-1;
			int v=sc.nextInt();
			BigHouse[b][f][r]+=v;
			if(BigHouse[b][f][r]<0){
				BigHouse[b][f][r]=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(" "+BigHouse[i][j][k]);
				}
				System.out.println();
			}
			if(i!=3){
				System.out.println("####################");
			}
		}
	}

} Main public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int[][][] BigHouse=new int[4][3][10];
		for(int i=0;i<4;i++){
			for(int j=0;j<3;j++){
				for(int k=0;k<10;k++){
					BigHouse[i][j][k]=0;
				}
			}
		}

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

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

		int order=sc.nextInt();
		for(int i=0;i<order;i++){
			int b=sc.nextInt()-1;
			int f=sc.nextInt()-1;
			int r=sc.nextInt()-1;
			int v=sc.nextInt();
			BigHouse[b][f][r]+=v;
			if(BigHouse[b][f][r]<0){
				BigHouse[b][f][r]=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(" "+BigHouse[i][j][k]);
				}
				System.out.println();
			}
			if(i!=3){
				System.out.println("####################");
			}
		}
	}

} public class Main{

	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int[][][] BigHouse=new int[4][3][10];
		for(int i=0;i<4;i++){
			for(int j=0;j<3;j++){
				for(int k=0;k<10;k++){
					BigHouse[i][j][k]=0;
				}
			}
		}

		int order=sc.nextInt();
		for(int i=0;i<order;i++){
			int b=sc.nextInt()-1;
			int f=sc.nextInt()-1;
			int r=sc.nextInt()-1;
			int v=sc.nextInt();
			BigHouse[b][f][r]+=v;
			if(BigHouse[b][f][r]<0){
				BigHouse[b][f][r]=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(" "+BigHouse[i][j][k]);
				}
				System.out.println();
			}
			if(i!=3){
				System.out.println("####################");
			}
		}
	}

} Main
import java.util.Scanner;

public class Main{

	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int[][][] BigHouse=new int[4][3][10];
		for(int i=0;i<4;i++){
			for(int j=0;j<3;j++){
				for(int k=0;k<10;k++){
					BigHouse[i][j][k]=0;
				}
			}
		}

		int order=sc.nextInt();
		for(int i=0;i<order;i++){
			int b=sc.nextInt()-1;
			int f=sc.nextInt()-1;
			int r=sc.nextInt()-1;
			int v=sc.nextInt();
			BigHouse[b][f][r]+=v;
			if(BigHouse[b][f][r]<0){
				BigHouse[b][f][r]=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(" "+BigHouse[i][j][k]);
				}
				System.out.println();
			}
			if(i!=3){
				System.out.println("####################");
			}
		}
	}

}

