
import java.util.*;

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

import java.util.*;

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