import java.util.*;

class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int [][][]ho =new int[4][3][10];
int n =sc.nextInt();
for(;n>0;n--){
int a =sc.nextInt();
int b =sc.nextInt();
int c =sc.nextInt();
int d =sc.nextInt();
ho[a-1][b-1][c-1] += d;
}
for(int e=0; e<4; e++){
	for(int f=0; f<3; f++){
		for(int g=0; g<10; g++){
			System.out.print(" "+ho[e][f][g]);
		if(g ==9) System.out.println();
	}
	
	}
if(e<3) System.out.println("####################");
}
}
} import java.util.*; util.* java class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int [][][]ho =new int[4][3][10];
int n =sc.nextInt();
for(;n>0;n--){
int a =sc.nextInt();
int b =sc.nextInt();
int c =sc.nextInt();
int d =sc.nextInt();
ho[a-1][b-1][c-1] += d;
}
for(int e=0; e<4; e++){
	for(int f=0; f<3; f++){
		for(int g=0; g<10; g++){
			System.out.print(" "+ho[e][f][g]);
		if(g ==9) System.out.println();
	}
	
	}
if(e<3) System.out.println("####################");
}
}
} Main public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int [][][]ho =new int[4][3][10];
int n =sc.nextInt();
for(;n>0;n--){
int a =sc.nextInt();
int b =sc.nextInt();
int c =sc.nextInt();
int d =sc.nextInt();
ho[a-1][b-1][c-1] += d;
}
for(int e=0; e<4; e++){
	for(int f=0; f<3; f++){
		for(int g=0; g<10; g++){
			System.out.print(" "+ho[e][f][g]);
		if(g ==9) System.out.println();
	}
	
	}
if(e<3) System.out.println("####################");
}
} main {
Scanner sc = new Scanner(System.in);
int [][][]ho =new int[4][3][10];
int n =sc.nextInt();
for(;n>0;n--){
int a =sc.nextInt();
int b =sc.nextInt();
int c =sc.nextInt();
int d =sc.nextInt();
ho[a-1][b-1][c-1] += d;
}
for(int e=0; e<4; e++){
	for(int f=0; f<3; f++){
		for(int g=0; g<10; g++){
			System.out.print(" "+ho[e][f][g]);
		if(g ==9) System.out.println();
	}
	
	}
if(e<3) System.out.println("####################");
}
} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int [][][]ho =new int[4][3][10]; ho new int[4][3][10] 4 3 10 int n =sc.nextInt(); n sc.nextInt() sc.nextInt sc for(;n>0;n--){
int a =sc.nextInt();
int b =sc.nextInt();
int c =sc.nextInt();
int d =sc.nextInt();
ho[a-1][b-1][c-1] += d;
} ; n>0 n 0 n-- n-- n {
int a =sc.nextInt();
int b =sc.nextInt();
int c =sc.nextInt();
int d =sc.nextInt();
ho[a-1][b-1][c-1] += d;
} {
int a =sc.nextInt();
int b =sc.nextInt();
int c =sc.nextInt();
int d =sc.nextInt();
ho[a-1][b-1][c-1] += d;
} int a =sc.nextInt(); a sc.nextInt() sc.nextInt sc int b =sc.nextInt(); b sc.nextInt() sc.nextInt sc int c =sc.nextInt(); c sc.nextInt() sc.nextInt sc int d =sc.nextInt(); d sc.nextInt() sc.nextInt sc ho[a-1][b-1][c-1] += d ho[a-1][b-1][c-1] ho[a-1][b-1] ho[a-1] ho a-1 a 1 b-1 b 1 c-1 c 1 d for(int e=0; e<4; e++){
	for(int f=0; f<3; f++){
		for(int g=0; g<10; g++){
			System.out.print(" "+ho[e][f][g]);
		if(g ==9) System.out.println();
	}
	
	}
if(e<3) System.out.println("####################");
} int e=0; int e=0; e 0 e<4 e 4 e++ e++ e {
	for(int f=0; f<3; f++){
		for(int g=0; g<10; g++){
			System.out.print(" "+ho[e][f][g]);
		if(g ==9) System.out.println();
	}
	
	}
if(e<3) System.out.println("####################");
} {
	for(int f=0; f<3; f++){
		for(int g=0; g<10; g++){
			System.out.print(" "+ho[e][f][g]);
		if(g ==9) System.out.println();
	}
	
	}
if(e<3) System.out.println("####################");
} for(int f=0; f<3; f++){
		for(int g=0; g<10; g++){
			System.out.print(" "+ho[e][f][g]);
		if(g ==9) System.out.println();
	}
	
	} int f=0; int f=0; f 0 f<3 f 3 f++ f++ f {
		for(int g=0; g<10; g++){
			System.out.print(" "+ho[e][f][g]);
		if(g ==9) System.out.println();
	}
	
	} {
		for(int g=0; g<10; g++){
			System.out.print(" "+ho[e][f][g]);
		if(g ==9) System.out.println();
	}
	
	} for(int g=0; g<10; g++){
			System.out.print(" "+ho[e][f][g]);
		if(g ==9) System.out.println();
	} int g=0; int g=0; g 0 g<10 g 10 g++ g++ g {
			System.out.print(" "+ho[e][f][g]);
		if(g ==9) System.out.println();
	} {
			System.out.print(" "+ho[e][f][g]);
		if(g ==9) System.out.println();
	} System.out.print(" "+ho[e][f][g]) System.out.print System.out System System.out " "+ho[e][f][g] " " ho[e][f][g] ho[e][f] ho[e] ho e f g if(g ==9) System.out.println(); g ==9 g 9 System.out.println() System.out.println System.out System System.out if(e<3) System.out.println("####################"); e<3 e 3 System.out.println("####################") System.out.println System.out System System.out "####################" String[] args args
import java.util.*;

class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int [][][]ho =new int[4][3][10];
int n =sc.nextInt();
for(;n>0;n--){
int a =sc.nextInt();
int b =sc.nextInt();
int c =sc.nextInt();
int d =sc.nextInt();
ho[a-1][b-1][c-1] += d;
}
for(int e=0; e<4; e++){
	for(int f=0; f<3; f++){
		for(int g=0; g<10; g++){
			System.out.print(" "+ho[e][f][g]);
		if(g ==9) System.out.println();
	}
	
	}
if(e<3) System.out.println("####################");
}
}
}