import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner x = new Scanner(System.in);
		int room1[][] = new int[3][10];
		int room2[][] = new int[3][10];
		int room3[][] = new int[3][10];
		int room4[][] = new int[3][10];
		int n = x.nextInt();
		for( int a = 0 ; a < 3 ; a++){
			for(int t = 0 ; t <10 ; t++){
				room1[a][t] = 0;
				room2[a][t] = 0;
				room3[a][t] = 0;
				room4[a][t] = 0;
			}
		}
		int b ;
		int f ;
		int r ;
		int v ;
		for( int i = 0 ; i < n ; i++){
			b = x.nextInt();
			f = x.nextInt();
			r = x.nextInt();
			v = x.nextInt();
			if(b == 1){
				room1[f-1][r-1]+= v;
			}else if(b ==2){
				room2[f-1][r-1]+= v;
			}else if( b== 3){
				room3[f-1][r-1]+= v;
			}else{
				room4[f-1][r-1]+= v;
			}
		}
		for(int d = 0 ; d <3 ; d++){
			for( int c = 0 ; c < 10 ; c++){
			System.out.print(" " + room1[d][c]);
			}
			System.out.println();
		}
		System.out.println("####################");
		for(int d = 0 ; d <3 ; d++){
			for( int c = 0 ; c < 10 ; c++){
			System.out.print(" " + room2[d][c]);
			}
			System.out.println();
		}
		System.out.println("####################");
		for(int d = 0 ; d <3 ; d++){
			for( int c = 0 ; c < 10 ; c++){
			System.out.print(" " + room3[d][c]);
			}
			System.out.println();
		}
		System.out.println("####################");
		for(int d = 0 ; d <3 ; d++){
			for( int c = 0 ; c < 10 ; c++){
			System.out.print(" " + room4[d][c]);
			}
			System.out.println();
		}
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner x = new Scanner(System.in);
		int room1[][] = new int[3][10];
		int room2[][] = new int[3][10];
		int room3[][] = new int[3][10];
		int room4[][] = new int[3][10];
		int n = x.nextInt();
		for( int a = 0 ; a < 3 ; a++){
			for(int t = 0 ; t <10 ; t++){
				room1[a][t] = 0;
				room2[a][t] = 0;
				room3[a][t] = 0;
				room4[a][t] = 0;
			}
		}
		int b ;
		int f ;
		int r ;
		int v ;
		for( int i = 0 ; i < n ; i++){
			b = x.nextInt();
			f = x.nextInt();
			r = x.nextInt();
			v = x.nextInt();
			if(b == 1){
				room1[f-1][r-1]+= v;
			}else if(b ==2){
				room2[f-1][r-1]+= v;
			}else if( b== 3){
				room3[f-1][r-1]+= v;
			}else{
				room4[f-1][r-1]+= v;
			}
		}
		for(int d = 0 ; d <3 ; d++){
			for( int c = 0 ; c < 10 ; c++){
			System.out.print(" " + room1[d][c]);
			}
			System.out.println();
		}
		System.out.println("####################");
		for(int d = 0 ; d <3 ; d++){
			for( int c = 0 ; c < 10 ; c++){
			System.out.print(" " + room2[d][c]);
			}
			System.out.println();
		}
		System.out.println("####################");
		for(int d = 0 ; d <3 ; d++){
			for( int c = 0 ; c < 10 ; c++){
			System.out.print(" " + room3[d][c]);
			}
			System.out.println();
		}
		System.out.println("####################");
		for(int d = 0 ; d <3 ; d++){
			for( int c = 0 ; c < 10 ; c++){
			System.out.print(" " + room4[d][c]);
			}
			System.out.println();
		}
	}
} Main public static void main(String[] args) {
		Scanner x = new Scanner(System.in);
		int room1[][] = new int[3][10];
		int room2[][] = new int[3][10];
		int room3[][] = new int[3][10];
		int room4[][] = new int[3][10];
		int n = x.nextInt();
		for( int a = 0 ; a < 3 ; a++){
			for(int t = 0 ; t <10 ; t++){
				room1[a][t] = 0;
				room2[a][t] = 0;
				room3[a][t] = 0;
				room4[a][t] = 0;
			}
		}
		int b ;
		int f ;
		int r ;
		int v ;
		for( int i = 0 ; i < n ; i++){
			b = x.nextInt();
			f = x.nextInt();
			r = x.nextInt();
			v = x.nextInt();
			if(b == 1){
				room1[f-1][r-1]+= v;
			}else if(b ==2){
				room2[f-1][r-1]+= v;
			}else if( b== 3){
				room3[f-1][r-1]+= v;
			}else{
				room4[f-1][r-1]+= v;
			}
		}
		for(int d = 0 ; d <3 ; d++){
			for( int c = 0 ; c < 10 ; c++){
			System.out.print(" " + room1[d][c]);
			}
			System.out.println();
		}
		System.out.println("####################");
		for(int d = 0 ; d <3 ; d++){
			for( int c = 0 ; c < 10 ; c++){
			System.out.print(" " + room2[d][c]);
			}
			System.out.println();
		}
		System.out.println("####################");
		for(int d = 0 ; d <3 ; d++){
			for( int c = 0 ; c < 10 ; c++){
			System.out.print(" " + room3[d][c]);
			}
			System.out.println();
		}
		System.out.println("####################");
		for(int d = 0 ; d <3 ; d++){
			for( int c = 0 ; c < 10 ; c++){
			System.out.print(" " + room4[d][c]);
			}
			System.out.println();
		}
	} main {
		Scanner x = new Scanner(System.in);
		int room1[][] = new int[3][10];
		int room2[][] = new int[3][10];
		int room3[][] = new int[3][10];
		int room4[][] = new int[3][10];
		int n = x.nextInt();
		for( int a = 0 ; a < 3 ; a++){
			for(int t = 0 ; t <10 ; t++){
				room1[a][t] = 0;
				room2[a][t] = 0;
				room3[a][t] = 0;
				room4[a][t] = 0;
			}
		}
		int b ;
		int f ;
		int r ;
		int v ;
		for( int i = 0 ; i < n ; i++){
			b = x.nextInt();
			f = x.nextInt();
			r = x.nextInt();
			v = x.nextInt();
			if(b == 1){
				room1[f-1][r-1]+= v;
			}else if(b ==2){
				room2[f-1][r-1]+= v;
			}else if( b== 3){
				room3[f-1][r-1]+= v;
			}else{
				room4[f-1][r-1]+= v;
			}
		}
		for(int d = 0 ; d <3 ; d++){
			for( int c = 0 ; c < 10 ; c++){
			System.out.print(" " + room1[d][c]);
			}
			System.out.println();
		}
		System.out.println("####################");
		for(int d = 0 ; d <3 ; d++){
			for( int c = 0 ; c < 10 ; c++){
			System.out.print(" " + room2[d][c]);
			}
			System.out.println();
		}
		System.out.println("####################");
		for(int d = 0 ; d <3 ; d++){
			for( int c = 0 ; c < 10 ; c++){
			System.out.print(" " + room3[d][c]);
			}
			System.out.println();
		}
		System.out.println("####################");
		for(int d = 0 ; d <3 ; d++){
			for( int c = 0 ; c < 10 ; c++){
			System.out.print(" " + room4[d][c]);
			}
			System.out.println();
		}
	} Scanner x = new Scanner(System.in); x new Scanner(System.in) int room1[][] = new int[3][10]; room1 new int[3][10] 3 10 int room2[][] = new int[3][10]; room2 new int[3][10] 3 10 int room3[][] = new int[3][10]; room3 new int[3][10] 3 10 int room4[][] = new int[3][10]; room4 new int[3][10] 3 10 int n = x.nextInt(); n x.nextInt() x.nextInt x for( int a = 0 ; a < 3 ; a++){
			for(int t = 0 ; t <10 ; t++){
				room1[a][t] = 0;
				room2[a][t] = 0;
				room3[a][t] = 0;
				room4[a][t] = 0;
			}
		} int a = 0 ; int a = 0 ; a 0 a < 3 a 3 a++ a++ a {
			for(int t = 0 ; t <10 ; t++){
				room1[a][t] = 0;
				room2[a][t] = 0;
				room3[a][t] = 0;
				room4[a][t] = 0;
			}
		} {
			for(int t = 0 ; t <10 ; t++){
				room1[a][t] = 0;
				room2[a][t] = 0;
				room3[a][t] = 0;
				room4[a][t] = 0;
			}
		} for(int t = 0 ; t <10 ; t++){
				room1[a][t] = 0;
				room2[a][t] = 0;
				room3[a][t] = 0;
				room4[a][t] = 0;
			} int t = 0 ; int t = 0 ; t 0 t <10 t 10 t++ t++ t {
				room1[a][t] = 0;
				room2[a][t] = 0;
				room3[a][t] = 0;
				room4[a][t] = 0;
			} {
				room1[a][t] = 0;
				room2[a][t] = 0;
				room3[a][t] = 0;
				room4[a][t] = 0;
			} room1[a][t] = 0 room1[a][t] room1[a] room1 a t 0 room2[a][t] = 0 room2[a][t] room2[a] room2 a t 0 room3[a][t] = 0 room3[a][t] room3[a] room3 a t 0 room4[a][t] = 0 room4[a][t] room4[a] room4 a t 0 int b ; b int f ; f int r ; r int v ; v for( int i = 0 ; i < n ; i++){
			b = x.nextInt();
			f = x.nextInt();
			r = x.nextInt();
			v = x.nextInt();
			if(b == 1){
				room1[f-1][r-1]+= v;
			}else if(b ==2){
				room2[f-1][r-1]+= v;
			}else if( b== 3){
				room3[f-1][r-1]+= v;
			}else{
				room4[f-1][r-1]+= v;
			}
		} int i = 0 ; int i = 0 ; i 0 i < n i n i++ i++ i {
			b = x.nextInt();
			f = x.nextInt();
			r = x.nextInt();
			v = x.nextInt();
			if(b == 1){
				room1[f-1][r-1]+= v;
			}else if(b ==2){
				room2[f-1][r-1]+= v;
			}else if( b== 3){
				room3[f-1][r-1]+= v;
			}else{
				room4[f-1][r-1]+= v;
			}
		} {
			b = x.nextInt();
			f = x.nextInt();
			r = x.nextInt();
			v = x.nextInt();
			if(b == 1){
				room1[f-1][r-1]+= v;
			}else if(b ==2){
				room2[f-1][r-1]+= v;
			}else if( b== 3){
				room3[f-1][r-1]+= v;
			}else{
				room4[f-1][r-1]+= v;
			}
		} b = x.nextInt() b x.nextInt() x.nextInt x f = x.nextInt() f x.nextInt() x.nextInt x r = x.nextInt() r x.nextInt() x.nextInt x v = x.nextInt() v x.nextInt() x.nextInt x if(b == 1){
				room1[f-1][r-1]+= v;
			}else if(b ==2){
				room2[f-1][r-1]+= v;
			}else if( b== 3){
				room3[f-1][r-1]+= v;
			}else{
				room4[f-1][r-1]+= v;
			} b == 1 b 1 {
				room1[f-1][r-1]+= v;
			} room1[f-1][r-1]+= v room1[f-1][r-1] room1[f-1] room1 f-1 f 1 r-1 r 1 v if(b ==2){
				room2[f-1][r-1]+= v;
			}else if( b== 3){
				room3[f-1][r-1]+= v;
			}else{
				room4[f-1][r-1]+= v;
			} b ==2 b 2 {
				room2[f-1][r-1]+= v;
			} room2[f-1][r-1]+= v room2[f-1][r-1] room2[f-1] room2 f-1 f 1 r-1 r 1 v if( b== 3){
				room3[f-1][r-1]+= v;
			}else{
				room4[f-1][r-1]+= v;
			} b== 3 b 3 {
				room3[f-1][r-1]+= v;
			} room3[f-1][r-1]+= v room3[f-1][r-1] room3[f-1] room3 f-1 f 1 r-1 r 1 v {
				room4[f-1][r-1]+= v;
			} room4[f-1][r-1]+= v room4[f-1][r-1] room4[f-1] room4 f-1 f 1 r-1 r 1 v for(int d = 0 ; d <3 ; d++){
			for( int c = 0 ; c < 10 ; c++){
			System.out.print(" " + room1[d][c]);
			}
			System.out.println();
		} int d = 0 ; int d = 0 ; d 0 d <3 d 3 d++ d++ d {
			for( int c = 0 ; c < 10 ; c++){
			System.out.print(" " + room1[d][c]);
			}
			System.out.println();
		} {
			for( int c = 0 ; c < 10 ; c++){
			System.out.print(" " + room1[d][c]);
			}
			System.out.println();
		} for( int c = 0 ; c < 10 ; c++){
			System.out.print(" " + room1[d][c]);
			} int c = 0 ; int c = 0 ; c 0 c < 10 c 10 c++ c++ c {
			System.out.print(" " + room1[d][c]);
			} {
			System.out.print(" " + room1[d][c]);
			} System.out.print(" " + room1[d][c]) System.out.print System.out System System.out " " + room1[d][c] " " room1[d][c] room1[d] room1 d c System.out.println() System.out.println System.out System System.out System.out.println("####################") System.out.println System.out System System.out "####################" for(int d = 0 ; d <3 ; d++){
			for( int c = 0 ; c < 10 ; c++){
			System.out.print(" " + room2[d][c]);
			}
			System.out.println();
		} int d = 0 ; int d = 0 ; d 0 d <3 d 3 d++ d++ d {
			for( int c = 0 ; c < 10 ; c++){
			System.out.print(" " + room2[d][c]);
			}
			System.out.println();
		} {
			for( int c = 0 ; c < 10 ; c++){
			System.out.print(" " + room2[d][c]);
			}
			System.out.println();
		} for( int c = 0 ; c < 10 ; c++){
			System.out.print(" " + room2[d][c]);
			} int c = 0 ; int c = 0 ; c 0 c < 10 c 10 c++ c++ c {
			System.out.print(" " + room2[d][c]);
			} {
			System.out.print(" " + room2[d][c]);
			} System.out.print(" " + room2[d][c]) System.out.print System.out System System.out " " + room2[d][c] " " room2[d][c] room2[d] room2 d c System.out.println() System.out.println System.out System System.out System.out.println("####################") System.out.println System.out System System.out "####################" for(int d = 0 ; d <3 ; d++){
			for( int c = 0 ; c < 10 ; c++){
			System.out.print(" " + room3[d][c]);
			}
			System.out.println();
		} int d = 0 ; int d = 0 ; d 0 d <3 d 3 d++ d++ d {
			for( int c = 0 ; c < 10 ; c++){
			System.out.print(" " + room3[d][c]);
			}
			System.out.println();
		} {
			for( int c = 0 ; c < 10 ; c++){
			System.out.print(" " + room3[d][c]);
			}
			System.out.println();
		} for( int c = 0 ; c < 10 ; c++){
			System.out.print(" " + room3[d][c]);
			} int c = 0 ; int c = 0 ; c 0 c < 10 c 10 c++ c++ c {
			System.out.print(" " + room3[d][c]);
			} {
			System.out.print(" " + room3[d][c]);
			} System.out.print(" " + room3[d][c]) System.out.print System.out System System.out " " + room3[d][c] " " room3[d][c] room3[d] room3 d c System.out.println() System.out.println System.out System System.out System.out.println("####################") System.out.println System.out System System.out "####################" for(int d = 0 ; d <3 ; d++){
			for( int c = 0 ; c < 10 ; c++){
			System.out.print(" " + room4[d][c]);
			}
			System.out.println();
		} int d = 0 ; int d = 0 ; d 0 d <3 d 3 d++ d++ d {
			for( int c = 0 ; c < 10 ; c++){
			System.out.print(" " + room4[d][c]);
			}
			System.out.println();
		} {
			for( int c = 0 ; c < 10 ; c++){
			System.out.print(" " + room4[d][c]);
			}
			System.out.println();
		} for( int c = 0 ; c < 10 ; c++){
			System.out.print(" " + room4[d][c]);
			} int c = 0 ; int c = 0 ; c 0 c < 10 c 10 c++ c++ c {
			System.out.print(" " + room4[d][c]);
			} {
			System.out.print(" " + room4[d][c]);
			} System.out.print(" " + room4[d][c]) System.out.print System.out System System.out " " + room4[d][c] " " room4[d][c] room4[d] room4 d c System.out.println() System.out.println System.out System System.out String[] args args public class Main {
	public static void main(String[] args) {
		Scanner x = new Scanner(System.in);
		int room1[][] = new int[3][10];
		int room2[][] = new int[3][10];
		int room3[][] = new int[3][10];
		int room4[][] = new int[3][10];
		int n = x.nextInt();
		for( int a = 0 ; a < 3 ; a++){
			for(int t = 0 ; t <10 ; t++){
				room1[a][t] = 0;
				room2[a][t] = 0;
				room3[a][t] = 0;
				room4[a][t] = 0;
			}
		}
		int b ;
		int f ;
		int r ;
		int v ;
		for( int i = 0 ; i < n ; i++){
			b = x.nextInt();
			f = x.nextInt();
			r = x.nextInt();
			v = x.nextInt();
			if(b == 1){
				room1[f-1][r-1]+= v;
			}else if(b ==2){
				room2[f-1][r-1]+= v;
			}else if( b== 3){
				room3[f-1][r-1]+= v;
			}else{
				room4[f-1][r-1]+= v;
			}
		}
		for(int d = 0 ; d <3 ; d++){
			for( int c = 0 ; c < 10 ; c++){
			System.out.print(" " + room1[d][c]);
			}
			System.out.println();
		}
		System.out.println("####################");
		for(int d = 0 ; d <3 ; d++){
			for( int c = 0 ; c < 10 ; c++){
			System.out.print(" " + room2[d][c]);
			}
			System.out.println();
		}
		System.out.println("####################");
		for(int d = 0 ; d <3 ; d++){
			for( int c = 0 ; c < 10 ; c++){
			System.out.print(" " + room3[d][c]);
			}
			System.out.println();
		}
		System.out.println("####################");
		for(int d = 0 ; d <3 ; d++){
			for( int c = 0 ; c < 10 ; c++){
			System.out.print(" " + room4[d][c]);
			}
			System.out.println();
		}
	}
} public class Main {
	public static void main(String[] args) {
		Scanner x = new Scanner(System.in);
		int room1[][] = new int[3][10];
		int room2[][] = new int[3][10];
		int room3[][] = new int[3][10];
		int room4[][] = new int[3][10];
		int n = x.nextInt();
		for( int a = 0 ; a < 3 ; a++){
			for(int t = 0 ; t <10 ; t++){
				room1[a][t] = 0;
				room2[a][t] = 0;
				room3[a][t] = 0;
				room4[a][t] = 0;
			}
		}
		int b ;
		int f ;
		int r ;
		int v ;
		for( int i = 0 ; i < n ; i++){
			b = x.nextInt();
			f = x.nextInt();
			r = x.nextInt();
			v = x.nextInt();
			if(b == 1){
				room1[f-1][r-1]+= v;
			}else if(b ==2){
				room2[f-1][r-1]+= v;
			}else if( b== 3){
				room3[f-1][r-1]+= v;
			}else{
				room4[f-1][r-1]+= v;
			}
		}
		for(int d = 0 ; d <3 ; d++){
			for( int c = 0 ; c < 10 ; c++){
			System.out.print(" " + room1[d][c]);
			}
			System.out.println();
		}
		System.out.println("####################");
		for(int d = 0 ; d <3 ; d++){
			for( int c = 0 ; c < 10 ; c++){
			System.out.print(" " + room2[d][c]);
			}
			System.out.println();
		}
		System.out.println("####################");
		for(int d = 0 ; d <3 ; d++){
			for( int c = 0 ; c < 10 ; c++){
			System.out.print(" " + room3[d][c]);
			}
			System.out.println();
		}
		System.out.println("####################");
		for(int d = 0 ; d <3 ; d++){
			for( int c = 0 ; c < 10 ; c++){
			System.out.print(" " + room4[d][c]);
			}
			System.out.println();
		}
	}
} Main
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner x = new Scanner(System.in);
		int room1[][] = new int[3][10];
		int room2[][] = new int[3][10];
		int room3[][] = new int[3][10];
		int room4[][] = new int[3][10];
		int n = x.nextInt();
		for( int a = 0 ; a < 3 ; a++){
			for(int t = 0 ; t <10 ; t++){
				room1[a][t] = 0;
				room2[a][t] = 0;
				room3[a][t] = 0;
				room4[a][t] = 0;
			}
		}
		int b ;
		int f ;
		int r ;
		int v ;
		for( int i = 0 ; i < n ; i++){
			b = x.nextInt();
			f = x.nextInt();
			r = x.nextInt();
			v = x.nextInt();
			if(b == 1){
				room1[f-1][r-1]+= v;
			}else if(b ==2){
				room2[f-1][r-1]+= v;
			}else if( b== 3){
				room3[f-1][r-1]+= v;
			}else{
				room4[f-1][r-1]+= v;
			}
		}
		for(int d = 0 ; d <3 ; d++){
			for( int c = 0 ; c < 10 ; c++){
			System.out.print(" " + room1[d][c]);
			}
			System.out.println();
		}
		System.out.println("####################");
		for(int d = 0 ; d <3 ; d++){
			for( int c = 0 ; c < 10 ; c++){
			System.out.print(" " + room2[d][c]);
			}
			System.out.println();
		}
		System.out.println("####################");
		for(int d = 0 ; d <3 ; d++){
			for( int c = 0 ; c < 10 ; c++){
			System.out.print(" " + room3[d][c]);
			}
			System.out.println();
		}
		System.out.println("####################");
		for(int d = 0 ; d <3 ; d++){
			for( int c = 0 ; c < 10 ; c++){
			System.out.print(" " + room4[d][c]);
			}
			System.out.println();
		}
	}
}