import java.util.*;

public class Main {
	public static void main(String[] args){
		Scanner sc= new Scanner(System.in);
		int ma[][]=new int[3][10];
		int mb[][]=new int[3][10];
		int mc[][]=new int[3][10];
		int md[][]=new int[3][10];
		for(int i=0;i<3;i++){
			for(int j=0;j<10;j++){
				ma[i][j]=0;
				mb[i][j]=0;
				mc[i][j]=0;
				md[i][j]=0;
			}
		}
		int n=sc.nextInt();
		for(int i=0;i<n;i++){
			int b=sc.nextInt();
			int f=sc.nextInt();
			int r=sc.nextInt();
			int v=sc.nextInt();
			switch(b){
			case 1:
				ma[f-1][r-1]+=v;
				break;
			case 2:
				mb[f-1][r-1]+=v;
				break;
			case 3:
				mc[f-1][r-1]+=v;
				break;
			case 4:
				md[f-1][r-1]+=v;
				break;
			}
		}
		for(int i=0;i<3;i++){
			for(int j=0;j<10;j++){
				System.out.print(" "+ma[i][j]);
			}
			System.out.println();
		}
		System.out.println("####################");
		for(int i=0;i<3;i++){
			for(int j=0;j<10;j++){
				System.out.print(" "+mb[i][j]);
			}
			System.out.println();
		}
		System.out.println("####################");
		for(int i=0;i<3;i++){
			for(int j=0;j<10;j++){
				System.out.print(" "+mc[i][j]);
			}
			System.out.println();
		}
		System.out.println("####################");
		for(int i=0;i<3;i++){
			for(int j=0;j<10;j++){
				System.out.print(" "+md[i][j]);
			}
			System.out.println();
		}
	}
} import java.util.*; util.* java public class Main {
	public static void main(String[] args){
		Scanner sc= new Scanner(System.in);
		int ma[][]=new int[3][10];
		int mb[][]=new int[3][10];
		int mc[][]=new int[3][10];
		int md[][]=new int[3][10];
		for(int i=0;i<3;i++){
			for(int j=0;j<10;j++){
				ma[i][j]=0;
				mb[i][j]=0;
				mc[i][j]=0;
				md[i][j]=0;
			}
		}
		int n=sc.nextInt();
		for(int i=0;i<n;i++){
			int b=sc.nextInt();
			int f=sc.nextInt();
			int r=sc.nextInt();
			int v=sc.nextInt();
			switch(b){
			case 1:
				ma[f-1][r-1]+=v;
				break;
			case 2:
				mb[f-1][r-1]+=v;
				break;
			case 3:
				mc[f-1][r-1]+=v;
				break;
			case 4:
				md[f-1][r-1]+=v;
				break;
			}
		}
		for(int i=0;i<3;i++){
			for(int j=0;j<10;j++){
				System.out.print(" "+ma[i][j]);
			}
			System.out.println();
		}
		System.out.println("####################");
		for(int i=0;i<3;i++){
			for(int j=0;j<10;j++){
				System.out.print(" "+mb[i][j]);
			}
			System.out.println();
		}
		System.out.println("####################");
		for(int i=0;i<3;i++){
			for(int j=0;j<10;j++){
				System.out.print(" "+mc[i][j]);
			}
			System.out.println();
		}
		System.out.println("####################");
		for(int i=0;i<3;i++){
			for(int j=0;j<10;j++){
				System.out.print(" "+md[i][j]);
			}
			System.out.println();
		}
	}
} Main public static void main(String[] args){
		Scanner sc= new Scanner(System.in);
		int ma[][]=new int[3][10];
		int mb[][]=new int[3][10];
		int mc[][]=new int[3][10];
		int md[][]=new int[3][10];
		for(int i=0;i<3;i++){
			for(int j=0;j<10;j++){
				ma[i][j]=0;
				mb[i][j]=0;
				mc[i][j]=0;
				md[i][j]=0;
			}
		}
		int n=sc.nextInt();
		for(int i=0;i<n;i++){
			int b=sc.nextInt();
			int f=sc.nextInt();
			int r=sc.nextInt();
			int v=sc.nextInt();
			switch(b){
			case 1:
				ma[f-1][r-1]+=v;
				break;
			case 2:
				mb[f-1][r-1]+=v;
				break;
			case 3:
				mc[f-1][r-1]+=v;
				break;
			case 4:
				md[f-1][r-1]+=v;
				break;
			}
		}
		for(int i=0;i<3;i++){
			for(int j=0;j<10;j++){
				System.out.print(" "+ma[i][j]);
			}
			System.out.println();
		}
		System.out.println("####################");
		for(int i=0;i<3;i++){
			for(int j=0;j<10;j++){
				System.out.print(" "+mb[i][j]);
			}
			System.out.println();
		}
		System.out.println("####################");
		for(int i=0;i<3;i++){
			for(int j=0;j<10;j++){
				System.out.print(" "+mc[i][j]);
			}
			System.out.println();
		}
		System.out.println("####################");
		for(int i=0;i<3;i++){
			for(int j=0;j<10;j++){
				System.out.print(" "+md[i][j]);
			}
			System.out.println();
		}
	} main {
		Scanner sc= new Scanner(System.in);
		int ma[][]=new int[3][10];
		int mb[][]=new int[3][10];
		int mc[][]=new int[3][10];
		int md[][]=new int[3][10];
		for(int i=0;i<3;i++){
			for(int j=0;j<10;j++){
				ma[i][j]=0;
				mb[i][j]=0;
				mc[i][j]=0;
				md[i][j]=0;
			}
		}
		int n=sc.nextInt();
		for(int i=0;i<n;i++){
			int b=sc.nextInt();
			int f=sc.nextInt();
			int r=sc.nextInt();
			int v=sc.nextInt();
			switch(b){
			case 1:
				ma[f-1][r-1]+=v;
				break;
			case 2:
				mb[f-1][r-1]+=v;
				break;
			case 3:
				mc[f-1][r-1]+=v;
				break;
			case 4:
				md[f-1][r-1]+=v;
				break;
			}
		}
		for(int i=0;i<3;i++){
			for(int j=0;j<10;j++){
				System.out.print(" "+ma[i][j]);
			}
			System.out.println();
		}
		System.out.println("####################");
		for(int i=0;i<3;i++){
			for(int j=0;j<10;j++){
				System.out.print(" "+mb[i][j]);
			}
			System.out.println();
		}
		System.out.println("####################");
		for(int i=0;i<3;i++){
			for(int j=0;j<10;j++){
				System.out.print(" "+mc[i][j]);
			}
			System.out.println();
		}
		System.out.println("####################");
		for(int i=0;i<3;i++){
			for(int j=0;j<10;j++){
				System.out.print(" "+md[i][j]);
			}
			System.out.println();
		}
	} Scanner sc= new Scanner(System.in); sc new Scanner(System.in) int ma[][]=new int[3][10]; ma new int[3][10] 3 10 int mb[][]=new int[3][10]; mb new int[3][10] 3 10 int mc[][]=new int[3][10]; mc new int[3][10] 3 10 int md[][]=new int[3][10]; md new int[3][10] 3 10 for(int i=0;i<3;i++){
			for(int j=0;j<10;j++){
				ma[i][j]=0;
				mb[i][j]=0;
				mc[i][j]=0;
				md[i][j]=0;
			}
		} int i=0; int i=0; i 0 i<3 i 3 i++ i++ i {
			for(int j=0;j<10;j++){
				ma[i][j]=0;
				mb[i][j]=0;
				mc[i][j]=0;
				md[i][j]=0;
			}
		} {
			for(int j=0;j<10;j++){
				ma[i][j]=0;
				mb[i][j]=0;
				mc[i][j]=0;
				md[i][j]=0;
			}
		} for(int j=0;j<10;j++){
				ma[i][j]=0;
				mb[i][j]=0;
				mc[i][j]=0;
				md[i][j]=0;
			} int j=0; int j=0; j 0 j<10 j 10 j++ j++ j {
				ma[i][j]=0;
				mb[i][j]=0;
				mc[i][j]=0;
				md[i][j]=0;
			} {
				ma[i][j]=0;
				mb[i][j]=0;
				mc[i][j]=0;
				md[i][j]=0;
			} ma[i][j]=0 ma[i][j] ma[i] ma i j 0 mb[i][j]=0 mb[i][j] mb[i] mb i j 0 mc[i][j]=0 mc[i][j] mc[i] mc i j 0 md[i][j]=0 md[i][j] md[i] md i j 0 int n=sc.nextInt(); n sc.nextInt() sc.nextInt sc for(int i=0;i<n;i++){
			int b=sc.nextInt();
			int f=sc.nextInt();
			int r=sc.nextInt();
			int v=sc.nextInt();
			switch(b){
			case 1:
				ma[f-1][r-1]+=v;
				break;
			case 2:
				mb[f-1][r-1]+=v;
				break;
			case 3:
				mc[f-1][r-1]+=v;
				break;
			case 4:
				md[f-1][r-1]+=v;
				break;
			}
		} int i=0; int i=0; i 0 i<n i n i++ i++ i {
			int b=sc.nextInt();
			int f=sc.nextInt();
			int r=sc.nextInt();
			int v=sc.nextInt();
			switch(b){
			case 1:
				ma[f-1][r-1]+=v;
				break;
			case 2:
				mb[f-1][r-1]+=v;
				break;
			case 3:
				mc[f-1][r-1]+=v;
				break;
			case 4:
				md[f-1][r-1]+=v;
				break;
			}
		} {
			int b=sc.nextInt();
			int f=sc.nextInt();
			int r=sc.nextInt();
			int v=sc.nextInt();
			switch(b){
			case 1:
				ma[f-1][r-1]+=v;
				break;
			case 2:
				mb[f-1][r-1]+=v;
				break;
			case 3:
				mc[f-1][r-1]+=v;
				break;
			case 4:
				md[f-1][r-1]+=v;
				break;
			}
		} int b=sc.nextInt(); b sc.nextInt() sc.nextInt sc int f=sc.nextInt(); f sc.nextInt() sc.nextInt sc int r=sc.nextInt(); r sc.nextInt() sc.nextInt sc int v=sc.nextInt(); v sc.nextInt() sc.nextInt sc switch(b){
			case 1:
				ma[f-1][r-1]+=v;
				break;
			case 2:
				mb[f-1][r-1]+=v;
				break;
			case 3:
				mc[f-1][r-1]+=v;
				break;
			case 4:
				md[f-1][r-1]+=v;
				break;
			} b case 1: 1 case 1: ma[f-1][r-1]+=v ma[f-1][r-1] ma[f-1] ma f-1 f 1 r-1 r 1 v break; case 2: 2 case 2: mb[f-1][r-1]+=v mb[f-1][r-1] mb[f-1] mb f-1 f 1 r-1 r 1 v break; case 3: 3 case 3: mc[f-1][r-1]+=v mc[f-1][r-1] mc[f-1] mc f-1 f 1 r-1 r 1 v break; case 4: 4 case 4: md[f-1][r-1]+=v md[f-1][r-1] md[f-1] md f-1 f 1 r-1 r 1 v break; for(int i=0;i<3;i++){
			for(int j=0;j<10;j++){
				System.out.print(" "+ma[i][j]);
			}
			System.out.println();
		} int i=0; int i=0; i 0 i<3 i 3 i++ i++ i {
			for(int j=0;j<10;j++){
				System.out.print(" "+ma[i][j]);
			}
			System.out.println();
		} {
			for(int j=0;j<10;j++){
				System.out.print(" "+ma[i][j]);
			}
			System.out.println();
		} for(int j=0;j<10;j++){
				System.out.print(" "+ma[i][j]);
			} int j=0; int j=0; j 0 j<10 j 10 j++ j++ j {
				System.out.print(" "+ma[i][j]);
			} {
				System.out.print(" "+ma[i][j]);
			} System.out.print(" "+ma[i][j]) System.out.print System.out System System.out " "+ma[i][j] " " ma[i][j] ma[i] ma i j System.out.println() System.out.println System.out System System.out System.out.println("####################") System.out.println System.out System System.out "####################" for(int i=0;i<3;i++){
			for(int j=0;j<10;j++){
				System.out.print(" "+mb[i][j]);
			}
			System.out.println();
		} int i=0; int i=0; i 0 i<3 i 3 i++ i++ i {
			for(int j=0;j<10;j++){
				System.out.print(" "+mb[i][j]);
			}
			System.out.println();
		} {
			for(int j=0;j<10;j++){
				System.out.print(" "+mb[i][j]);
			}
			System.out.println();
		} for(int j=0;j<10;j++){
				System.out.print(" "+mb[i][j]);
			} int j=0; int j=0; j 0 j<10 j 10 j++ j++ j {
				System.out.print(" "+mb[i][j]);
			} {
				System.out.print(" "+mb[i][j]);
			} System.out.print(" "+mb[i][j]) System.out.print System.out System System.out " "+mb[i][j] " " mb[i][j] mb[i] mb i j System.out.println() System.out.println System.out System System.out System.out.println("####################") System.out.println System.out System System.out "####################" for(int i=0;i<3;i++){
			for(int j=0;j<10;j++){
				System.out.print(" "+mc[i][j]);
			}
			System.out.println();
		} int i=0; int i=0; i 0 i<3 i 3 i++ i++ i {
			for(int j=0;j<10;j++){
				System.out.print(" "+mc[i][j]);
			}
			System.out.println();
		} {
			for(int j=0;j<10;j++){
				System.out.print(" "+mc[i][j]);
			}
			System.out.println();
		} for(int j=0;j<10;j++){
				System.out.print(" "+mc[i][j]);
			} int j=0; int j=0; j 0 j<10 j 10 j++ j++ j {
				System.out.print(" "+mc[i][j]);
			} {
				System.out.print(" "+mc[i][j]);
			} System.out.print(" "+mc[i][j]) System.out.print System.out System System.out " "+mc[i][j] " " mc[i][j] mc[i] mc i j System.out.println() System.out.println System.out System System.out System.out.println("####################") System.out.println System.out System System.out "####################" for(int i=0;i<3;i++){
			for(int j=0;j<10;j++){
				System.out.print(" "+md[i][j]);
			}
			System.out.println();
		} int i=0; int i=0; i 0 i<3 i 3 i++ i++ i {
			for(int j=0;j<10;j++){
				System.out.print(" "+md[i][j]);
			}
			System.out.println();
		} {
			for(int j=0;j<10;j++){
				System.out.print(" "+md[i][j]);
			}
			System.out.println();
		} for(int j=0;j<10;j++){
				System.out.print(" "+md[i][j]);
			} int j=0; int j=0; j 0 j<10 j 10 j++ j++ j {
				System.out.print(" "+md[i][j]);
			} {
				System.out.print(" "+md[i][j]);
			} System.out.print(" "+md[i][j]) System.out.print System.out System System.out " "+md[i][j] " " md[i][j] md[i] md 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 sc= new Scanner(System.in);
		int ma[][]=new int[3][10];
		int mb[][]=new int[3][10];
		int mc[][]=new int[3][10];
		int md[][]=new int[3][10];
		for(int i=0;i<3;i++){
			for(int j=0;j<10;j++){
				ma[i][j]=0;
				mb[i][j]=0;
				mc[i][j]=0;
				md[i][j]=0;
			}
		}
		int n=sc.nextInt();
		for(int i=0;i<n;i++){
			int b=sc.nextInt();
			int f=sc.nextInt();
			int r=sc.nextInt();
			int v=sc.nextInt();
			switch(b){
			case 1:
				ma[f-1][r-1]+=v;
				break;
			case 2:
				mb[f-1][r-1]+=v;
				break;
			case 3:
				mc[f-1][r-1]+=v;
				break;
			case 4:
				md[f-1][r-1]+=v;
				break;
			}
		}
		for(int i=0;i<3;i++){
			for(int j=0;j<10;j++){
				System.out.print(" "+ma[i][j]);
			}
			System.out.println();
		}
		System.out.println("####################");
		for(int i=0;i<3;i++){
			for(int j=0;j<10;j++){
				System.out.print(" "+mb[i][j]);
			}
			System.out.println();
		}
		System.out.println("####################");
		for(int i=0;i<3;i++){
			for(int j=0;j<10;j++){
				System.out.print(" "+mc[i][j]);
			}
			System.out.println();
		}
		System.out.println("####################");
		for(int i=0;i<3;i++){
			for(int j=0;j<10;j++){
				System.out.print(" "+md[i][j]);
			}
			System.out.println();
		}
	}
} public class Main {
	public static void main(String[] args){
		Scanner sc= new Scanner(System.in);
		int ma[][]=new int[3][10];
		int mb[][]=new int[3][10];
		int mc[][]=new int[3][10];
		int md[][]=new int[3][10];
		for(int i=0;i<3;i++){
			for(int j=0;j<10;j++){
				ma[i][j]=0;
				mb[i][j]=0;
				mc[i][j]=0;
				md[i][j]=0;
			}
		}
		int n=sc.nextInt();
		for(int i=0;i<n;i++){
			int b=sc.nextInt();
			int f=sc.nextInt();
			int r=sc.nextInt();
			int v=sc.nextInt();
			switch(b){
			case 1:
				ma[f-1][r-1]+=v;
				break;
			case 2:
				mb[f-1][r-1]+=v;
				break;
			case 3:
				mc[f-1][r-1]+=v;
				break;
			case 4:
				md[f-1][r-1]+=v;
				break;
			}
		}
		for(int i=0;i<3;i++){
			for(int j=0;j<10;j++){
				System.out.print(" "+ma[i][j]);
			}
			System.out.println();
		}
		System.out.println("####################");
		for(int i=0;i<3;i++){
			for(int j=0;j<10;j++){
				System.out.print(" "+mb[i][j]);
			}
			System.out.println();
		}
		System.out.println("####################");
		for(int i=0;i<3;i++){
			for(int j=0;j<10;j++){
				System.out.print(" "+mc[i][j]);
			}
			System.out.println();
		}
		System.out.println("####################");
		for(int i=0;i<3;i++){
			for(int j=0;j<10;j++){
				System.out.print(" "+md[i][j]);
			}
			System.out.println();
		}
	}
} Main
import java.util.*;

public class Main {
	public static void main(String[] args){
		Scanner sc= new Scanner(System.in);
		int ma[][]=new int[3][10];
		int mb[][]=new int[3][10];
		int mc[][]=new int[3][10];
		int md[][]=new int[3][10];
		for(int i=0;i<3;i++){
			for(int j=0;j<10;j++){
				ma[i][j]=0;
				mb[i][j]=0;
				mc[i][j]=0;
				md[i][j]=0;
			}
		}
		int n=sc.nextInt();
		for(int i=0;i<n;i++){
			int b=sc.nextInt();
			int f=sc.nextInt();
			int r=sc.nextInt();
			int v=sc.nextInt();
			switch(b){
			case 1:
				ma[f-1][r-1]+=v;
				break;
			case 2:
				mb[f-1][r-1]+=v;
				break;
			case 3:
				mc[f-1][r-1]+=v;
				break;
			case 4:
				md[f-1][r-1]+=v;
				break;
			}
		}
		for(int i=0;i<3;i++){
			for(int j=0;j<10;j++){
				System.out.print(" "+ma[i][j]);
			}
			System.out.println();
		}
		System.out.println("####################");
		for(int i=0;i<3;i++){
			for(int j=0;j<10;j++){
				System.out.print(" "+mb[i][j]);
			}
			System.out.println();
		}
		System.out.println("####################");
		for(int i=0;i<3;i++){
			for(int j=0;j<10;j++){
				System.out.print(" "+mc[i][j]);
			}
			System.out.println();
		}
		System.out.println("####################");
		for(int i=0;i<3;i++){
			for(int j=0;j<10;j++){
				System.out.print(" "+md[i][j]);
			}
			System.out.println();
		}
	}
}