import java.util.Scanner;

public class Main {
	public static void main(String[] args){
		Scanner scan=new Scanner(System.in);
		
		int a[][]=new int[16][10];
		int i,j;
		
		//初期化
		for(i=0;i<16;i++){
			for(j=0;j<10;j++){
				if(i%4==0)a[i][j]=-1;
				else a[i][j]=0;
			}
		}
		
		int n=scan.nextInt();
		for(i=0;i<n;i++){
			int b=scan.nextInt();
			int f=scan.nextInt();
			int r=scan.nextInt();
			int v=scan.nextInt();
			
			a[4*(b-1)+f][r-1]+=v;
		}
		
		for(i=1;i<16;i++){
			for(j=0;j<10;j++){
				if(a[i][j]==-1)System.out.print("##");
				else System.out.printf(" %d",a[i][j]);
			}
			System.out.println();
		}
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args){
		Scanner scan=new Scanner(System.in);
		
		int a[][]=new int[16][10];
		int i,j;
		
		//初期化
		for(i=0;i<16;i++){
			for(j=0;j<10;j++){
				if(i%4==0)a[i][j]=-1;
				else a[i][j]=0;
			}
		}
		
		int n=scan.nextInt();
		for(i=0;i<n;i++){
			int b=scan.nextInt();
			int f=scan.nextInt();
			int r=scan.nextInt();
			int v=scan.nextInt();
			
			a[4*(b-1)+f][r-1]+=v;
		}
		
		for(i=1;i<16;i++){
			for(j=0;j<10;j++){
				if(a[i][j]==-1)System.out.print("##");
				else System.out.printf(" %d",a[i][j]);
			}
			System.out.println();
		}
	}
} Main public static void main(String[] args){
		Scanner scan=new Scanner(System.in);
		
		int a[][]=new int[16][10];
		int i,j;
		
		//初期化
		for(i=0;i<16;i++){
			for(j=0;j<10;j++){
				if(i%4==0)a[i][j]=-1;
				else a[i][j]=0;
			}
		}
		
		int n=scan.nextInt();
		for(i=0;i<n;i++){
			int b=scan.nextInt();
			int f=scan.nextInt();
			int r=scan.nextInt();
			int v=scan.nextInt();
			
			a[4*(b-1)+f][r-1]+=v;
		}
		
		for(i=1;i<16;i++){
			for(j=0;j<10;j++){
				if(a[i][j]==-1)System.out.print("##");
				else System.out.printf(" %d",a[i][j]);
			}
			System.out.println();
		}
	} main {
		Scanner scan=new Scanner(System.in);
		
		int a[][]=new int[16][10];
		int i,j;
		
		//初期化
		for(i=0;i<16;i++){
			for(j=0;j<10;j++){
				if(i%4==0)a[i][j]=-1;
				else a[i][j]=0;
			}
		}
		
		int n=scan.nextInt();
		for(i=0;i<n;i++){
			int b=scan.nextInt();
			int f=scan.nextInt();
			int r=scan.nextInt();
			int v=scan.nextInt();
			
			a[4*(b-1)+f][r-1]+=v;
		}
		
		for(i=1;i<16;i++){
			for(j=0;j<10;j++){
				if(a[i][j]==-1)System.out.print("##");
				else System.out.printf(" %d",a[i][j]);
			}
			System.out.println();
		}
	} Scanner scan=new Scanner(System.in); scan new Scanner(System.in) int a[][]=new int[16][10]; a new int[16][10] 16 10 int i i j; j for(i=0;i<16;i++){
			for(j=0;j<10;j++){
				if(i%4==0)a[i][j]=-1;
				else a[i][j]=0;
			}
		} i=0; i=0 i 0 i<16 i 16 i++ i++ i {
			for(j=0;j<10;j++){
				if(i%4==0)a[i][j]=-1;
				else a[i][j]=0;
			}
		} {
			for(j=0;j<10;j++){
				if(i%4==0)a[i][j]=-1;
				else a[i][j]=0;
			}
		} for(j=0;j<10;j++){
				if(i%4==0)a[i][j]=-1;
				else a[i][j]=0;
			} j=0; j=0 j 0 j<10 j 10 j++ j++ j {
				if(i%4==0)a[i][j]=-1;
				else a[i][j]=0;
			} {
				if(i%4==0)a[i][j]=-1;
				else a[i][j]=0;
			} if(i%4==0)a[i][j]=-1;
				else a[i][j]=0; i%4==0 i%4 i 4 0 a[i][j]=-1 a[i][j] a[i] a i j -1 1 a[i][j]=0 a[i][j] a[i] a i j 0 int n=scan.nextInt(); n scan.nextInt() scan.nextInt scan for(i=0;i<n;i++){
			int b=scan.nextInt();
			int f=scan.nextInt();
			int r=scan.nextInt();
			int v=scan.nextInt();
			
			a[4*(b-1)+f][r-1]+=v;
		} i=0; i=0 i 0 i<n i n i++ i++ i {
			int b=scan.nextInt();
			int f=scan.nextInt();
			int r=scan.nextInt();
			int v=scan.nextInt();
			
			a[4*(b-1)+f][r-1]+=v;
		} {
			int b=scan.nextInt();
			int f=scan.nextInt();
			int r=scan.nextInt();
			int v=scan.nextInt();
			
			a[4*(b-1)+f][r-1]+=v;
		} int b=scan.nextInt(); b scan.nextInt() scan.nextInt scan int f=scan.nextInt(); f scan.nextInt() scan.nextInt scan int r=scan.nextInt(); r scan.nextInt() scan.nextInt scan int v=scan.nextInt(); v scan.nextInt() scan.nextInt scan a[4*(b-1)+f][r-1]+=v a[4*(b-1)+f][r-1] a[4*(b-1)+f] a 4*(b-1)+f 4*(b-1) 4 (b-1) b 1 f r-1 r 1 v for(i=1;i<16;i++){
			for(j=0;j<10;j++){
				if(a[i][j]==-1)System.out.print("##");
				else System.out.printf(" %d",a[i][j]);
			}
			System.out.println();
		} i=1; i=1 i 1 i<16 i 16 i++ i++ i {
			for(j=0;j<10;j++){
				if(a[i][j]==-1)System.out.print("##");
				else System.out.printf(" %d",a[i][j]);
			}
			System.out.println();
		} {
			for(j=0;j<10;j++){
				if(a[i][j]==-1)System.out.print("##");
				else System.out.printf(" %d",a[i][j]);
			}
			System.out.println();
		} for(j=0;j<10;j++){
				if(a[i][j]==-1)System.out.print("##");
				else System.out.printf(" %d",a[i][j]);
			} j=0; j=0 j 0 j<10 j 10 j++ j++ j {
				if(a[i][j]==-1)System.out.print("##");
				else System.out.printf(" %d",a[i][j]);
			} {
				if(a[i][j]==-1)System.out.print("##");
				else System.out.printf(" %d",a[i][j]);
			} if(a[i][j]==-1)System.out.print("##");
				else System.out.printf(" %d",a[i][j]); a[i][j]==-1 a[i][j] a[i] a i j -1 1 System.out.print("##") System.out.print System.out System System.out "##" System.out.printf(" %d",a[i][j]) System.out.printf System.out System System.out " %d" a[i][j] a[i] a i j System.out.println() System.out.println System.out System System.out String[] args args public class Main {
	public static void main(String[] args){
		Scanner scan=new Scanner(System.in);
		
		int a[][]=new int[16][10];
		int i,j;
		
		//初期化
		for(i=0;i<16;i++){
			for(j=0;j<10;j++){
				if(i%4==0)a[i][j]=-1;
				else a[i][j]=0;
			}
		}
		
		int n=scan.nextInt();
		for(i=0;i<n;i++){
			int b=scan.nextInt();
			int f=scan.nextInt();
			int r=scan.nextInt();
			int v=scan.nextInt();
			
			a[4*(b-1)+f][r-1]+=v;
		}
		
		for(i=1;i<16;i++){
			for(j=0;j<10;j++){
				if(a[i][j]==-1)System.out.print("##");
				else System.out.printf(" %d",a[i][j]);
			}
			System.out.println();
		}
	}
} public class Main {
	public static void main(String[] args){
		Scanner scan=new Scanner(System.in);
		
		int a[][]=new int[16][10];
		int i,j;
		
		//初期化
		for(i=0;i<16;i++){
			for(j=0;j<10;j++){
				if(i%4==0)a[i][j]=-1;
				else a[i][j]=0;
			}
		}
		
		int n=scan.nextInt();
		for(i=0;i<n;i++){
			int b=scan.nextInt();
			int f=scan.nextInt();
			int r=scan.nextInt();
			int v=scan.nextInt();
			
			a[4*(b-1)+f][r-1]+=v;
		}
		
		for(i=1;i<16;i++){
			for(j=0;j<10;j++){
				if(a[i][j]==-1)System.out.print("##");
				else System.out.printf(" %d",a[i][j]);
			}
			System.out.println();
		}
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args){
		Scanner scan=new Scanner(System.in);
		
		int a[][]=new int[16][10];
		int i,j;
		
		//初期化
		for(i=0;i<16;i++){
			for(j=0;j<10;j++){
				if(i%4==0)a[i][j]=-1;
				else a[i][j]=0;
			}
		}
		
		int n=scan.nextInt();
		for(i=0;i<n;i++){
			int b=scan.nextInt();
			int f=scan.nextInt();
			int r=scan.nextInt();
			int v=scan.nextInt();
			
			a[4*(b-1)+f][r-1]+=v;
		}
		
		for(i=1;i<16;i++){
			for(j=0;j<10;j++){
				if(a[i][j]==-1)System.out.print("##");
				else System.out.printf(" %d",a[i][j]);
			}
			System.out.println();
		}
	}
}
