import java.util.Scanner;

public class Main{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int intNum = scan.nextInt();
		int b;
		int f;
		int r;
		int v;
		int[][] intArray1 = new int[3][10];
		int[][] intArray2 = new int[3][10];
		int[][] intArray3 = new int[3][10];
		int[][] intArray4 = new int[3][10];

		for(int i = 0; i < intNum; i++){
			b = scan.nextInt();
			f = scan.nextInt();
			r = scan.nextInt();
			v = scan.nextInt();
			if(b == 1){
				intArray1[f-1][r-1] = intArray1[f-1][r-1] += v;
			}else if(b == 2){
				intArray2[f-1][r-1] = intArray2[f-1][r-1] + v;
			}else if(b == 3){
				intArray3[f-1][r-1] = intArray3[f-1][r-1] + v;
			}else if(b == 4){
				intArray4[f-1][r-1] = intArray4[f-1][r-1] + v;
			}
		}

		for(int i = 0; i < 3; i++){
			for(int j = 0; j < 10; j++){
				System.out.print(" " + intArray1[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(" " + intArray2[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(" " + intArray3[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(" " + intArray4[i][j]);
			}
			System.out.println();
		}
		scan.close();
	}
} import java.util.Scanner; Scanner java.util public class Main{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int intNum = scan.nextInt();
		int b;
		int f;
		int r;
		int v;
		int[][] intArray1 = new int[3][10];
		int[][] intArray2 = new int[3][10];
		int[][] intArray3 = new int[3][10];
		int[][] intArray4 = new int[3][10];

		for(int i = 0; i < intNum; i++){
			b = scan.nextInt();
			f = scan.nextInt();
			r = scan.nextInt();
			v = scan.nextInt();
			if(b == 1){
				intArray1[f-1][r-1] = intArray1[f-1][r-1] += v;
			}else if(b == 2){
				intArray2[f-1][r-1] = intArray2[f-1][r-1] + v;
			}else if(b == 3){
				intArray3[f-1][r-1] = intArray3[f-1][r-1] + v;
			}else if(b == 4){
				intArray4[f-1][r-1] = intArray4[f-1][r-1] + v;
			}
		}

		for(int i = 0; i < 3; i++){
			for(int j = 0; j < 10; j++){
				System.out.print(" " + intArray1[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(" " + intArray2[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(" " + intArray3[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(" " + intArray4[i][j]);
			}
			System.out.println();
		}
		scan.close();
	}
} Main public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int intNum = scan.nextInt();
		int b;
		int f;
		int r;
		int v;
		int[][] intArray1 = new int[3][10];
		int[][] intArray2 = new int[3][10];
		int[][] intArray3 = new int[3][10];
		int[][] intArray4 = new int[3][10];

		for(int i = 0; i < intNum; i++){
			b = scan.nextInt();
			f = scan.nextInt();
			r = scan.nextInt();
			v = scan.nextInt();
			if(b == 1){
				intArray1[f-1][r-1] = intArray1[f-1][r-1] += v;
			}else if(b == 2){
				intArray2[f-1][r-1] = intArray2[f-1][r-1] + v;
			}else if(b == 3){
				intArray3[f-1][r-1] = intArray3[f-1][r-1] + v;
			}else if(b == 4){
				intArray4[f-1][r-1] = intArray4[f-1][r-1] + v;
			}
		}

		for(int i = 0; i < 3; i++){
			for(int j = 0; j < 10; j++){
				System.out.print(" " + intArray1[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(" " + intArray2[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(" " + intArray3[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(" " + intArray4[i][j]);
			}
			System.out.println();
		}
		scan.close();
	} main {
		Scanner scan = new Scanner(System.in);
		int intNum = scan.nextInt();
		int b;
		int f;
		int r;
		int v;
		int[][] intArray1 = new int[3][10];
		int[][] intArray2 = new int[3][10];
		int[][] intArray3 = new int[3][10];
		int[][] intArray4 = new int[3][10];

		for(int i = 0; i < intNum; i++){
			b = scan.nextInt();
			f = scan.nextInt();
			r = scan.nextInt();
			v = scan.nextInt();
			if(b == 1){
				intArray1[f-1][r-1] = intArray1[f-1][r-1] += v;
			}else if(b == 2){
				intArray2[f-1][r-1] = intArray2[f-1][r-1] + v;
			}else if(b == 3){
				intArray3[f-1][r-1] = intArray3[f-1][r-1] + v;
			}else if(b == 4){
				intArray4[f-1][r-1] = intArray4[f-1][r-1] + v;
			}
		}

		for(int i = 0; i < 3; i++){
			for(int j = 0; j < 10; j++){
				System.out.print(" " + intArray1[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(" " + intArray2[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(" " + intArray3[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(" " + intArray4[i][j]);
			}
			System.out.println();
		}
		scan.close();
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int intNum = scan.nextInt(); intNum scan.nextInt() scan.nextInt scan int b; b int f; f int r; r int v; v int[][] intArray1 = new int[3][10]; intArray1 new int[3][10] 3 10 int[][] intArray2 = new int[3][10]; intArray2 new int[3][10] 3 10 int[][] intArray3 = new int[3][10]; intArray3 new int[3][10] 3 10 int[][] intArray4 = new int[3][10]; intArray4 new int[3][10] 3 10 for(int i = 0; i < intNum; i++){
			b = scan.nextInt();
			f = scan.nextInt();
			r = scan.nextInt();
			v = scan.nextInt();
			if(b == 1){
				intArray1[f-1][r-1] = intArray1[f-1][r-1] += v;
			}else if(b == 2){
				intArray2[f-1][r-1] = intArray2[f-1][r-1] + v;
			}else if(b == 3){
				intArray3[f-1][r-1] = intArray3[f-1][r-1] + v;
			}else if(b == 4){
				intArray4[f-1][r-1] = intArray4[f-1][r-1] + v;
			}
		} int i = 0; int i = 0; i 0 i < intNum i intNum i++ i++ i {
			b = scan.nextInt();
			f = scan.nextInt();
			r = scan.nextInt();
			v = scan.nextInt();
			if(b == 1){
				intArray1[f-1][r-1] = intArray1[f-1][r-1] += v;
			}else if(b == 2){
				intArray2[f-1][r-1] = intArray2[f-1][r-1] + v;
			}else if(b == 3){
				intArray3[f-1][r-1] = intArray3[f-1][r-1] + v;
			}else if(b == 4){
				intArray4[f-1][r-1] = intArray4[f-1][r-1] + v;
			}
		} {
			b = scan.nextInt();
			f = scan.nextInt();
			r = scan.nextInt();
			v = scan.nextInt();
			if(b == 1){
				intArray1[f-1][r-1] = intArray1[f-1][r-1] += v;
			}else if(b == 2){
				intArray2[f-1][r-1] = intArray2[f-1][r-1] + v;
			}else if(b == 3){
				intArray3[f-1][r-1] = intArray3[f-1][r-1] + v;
			}else if(b == 4){
				intArray4[f-1][r-1] = intArray4[f-1][r-1] + v;
			}
		} b = scan.nextInt() b scan.nextInt() scan.nextInt scan f = scan.nextInt() f scan.nextInt() scan.nextInt scan r = scan.nextInt() r scan.nextInt() scan.nextInt scan v = scan.nextInt() v scan.nextInt() scan.nextInt scan if(b == 1){
				intArray1[f-1][r-1] = intArray1[f-1][r-1] += v;
			}else if(b == 2){
				intArray2[f-1][r-1] = intArray2[f-1][r-1] + v;
			}else if(b == 3){
				intArray3[f-1][r-1] = intArray3[f-1][r-1] + v;
			}else if(b == 4){
				intArray4[f-1][r-1] = intArray4[f-1][r-1] + v;
			} b == 1 b 1 {
				intArray1[f-1][r-1] = intArray1[f-1][r-1] += v;
			} intArray1[f-1][r-1] = intArray1[f-1][r-1] += v intArray1[f-1][r-1] intArray1[f-1] intArray1 f-1 f 1 r-1 r 1 intArray1[f-1][r-1] += v intArray1[f-1][r-1] intArray1[f-1] intArray1 f-1 f 1 r-1 r 1 v if(b == 2){
				intArray2[f-1][r-1] = intArray2[f-1][r-1] + v;
			}else if(b == 3){
				intArray3[f-1][r-1] = intArray3[f-1][r-1] + v;
			}else if(b == 4){
				intArray4[f-1][r-1] = intArray4[f-1][r-1] + v;
			} b == 2 b 2 {
				intArray2[f-1][r-1] = intArray2[f-1][r-1] + v;
			} intArray2[f-1][r-1] = intArray2[f-1][r-1] + v intArray2[f-1][r-1] intArray2[f-1] intArray2 f-1 f 1 r-1 r 1 intArray2[f-1][r-1] + v intArray2[f-1][r-1] intArray2[f-1] intArray2 f-1 f 1 r-1 r 1 v if(b == 3){
				intArray3[f-1][r-1] = intArray3[f-1][r-1] + v;
			}else if(b == 4){
				intArray4[f-1][r-1] = intArray4[f-1][r-1] + v;
			} b == 3 b 3 {
				intArray3[f-1][r-1] = intArray3[f-1][r-1] + v;
			} intArray3[f-1][r-1] = intArray3[f-1][r-1] + v intArray3[f-1][r-1] intArray3[f-1] intArray3 f-1 f 1 r-1 r 1 intArray3[f-1][r-1] + v intArray3[f-1][r-1] intArray3[f-1] intArray3 f-1 f 1 r-1 r 1 v if(b == 4){
				intArray4[f-1][r-1] = intArray4[f-1][r-1] + v;
			} b == 4 b 4 {
				intArray4[f-1][r-1] = intArray4[f-1][r-1] + v;
			} intArray4[f-1][r-1] = intArray4[f-1][r-1] + v intArray4[f-1][r-1] intArray4[f-1] intArray4 f-1 f 1 r-1 r 1 intArray4[f-1][r-1] + v intArray4[f-1][r-1] intArray4[f-1] intArray4 f-1 f 1 r-1 r 1 v for(int i = 0; i < 3; i++){
			for(int j = 0; j < 10; j++){
				System.out.print(" " + intArray1[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(" " + intArray1[i][j]);
			}
			System.out.println();
		} {
			for(int j = 0; j < 10; j++){
				System.out.print(" " + intArray1[i][j]);
			}
			System.out.println();
		} for(int j = 0; j < 10; j++){
				System.out.print(" " + intArray1[i][j]);
			} int j = 0; int j = 0; j 0 j < 10 j 10 j++ j++ j {
				System.out.print(" " + intArray1[i][j]);
			} {
				System.out.print(" " + intArray1[i][j]);
			} System.out.print(" " + intArray1[i][j]) System.out.print System.out System System.out " " + intArray1[i][j] " " intArray1[i][j] intArray1[i] intArray1 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(" " + intArray2[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(" " + intArray2[i][j]);
			}
			System.out.println();
		} {
			for(int j = 0; j < 10; j++){
				System.out.print(" " + intArray2[i][j]);
			}
			System.out.println();
		} for(int j = 0; j < 10; j++){
				System.out.print(" " + intArray2[i][j]);
			} int j = 0; int j = 0; j 0 j < 10 j 10 j++ j++ j {
				System.out.print(" " + intArray2[i][j]);
			} {
				System.out.print(" " + intArray2[i][j]);
			} System.out.print(" " + intArray2[i][j]) System.out.print System.out System System.out " " + intArray2[i][j] " " intArray2[i][j] intArray2[i] intArray2 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(" " + intArray3[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(" " + intArray3[i][j]);
			}
			System.out.println();
		} {
			for(int j = 0; j < 10; j++){
				System.out.print(" " + intArray3[i][j]);
			}
			System.out.println();
		} for(int j = 0; j < 10; j++){
				System.out.print(" " + intArray3[i][j]);
			} int j = 0; int j = 0; j 0 j < 10 j 10 j++ j++ j {
				System.out.print(" " + intArray3[i][j]);
			} {
				System.out.print(" " + intArray3[i][j]);
			} System.out.print(" " + intArray3[i][j]) System.out.print System.out System System.out " " + intArray3[i][j] " " intArray3[i][j] intArray3[i] intArray3 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(" " + intArray4[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(" " + intArray4[i][j]);
			}
			System.out.println();
		} {
			for(int j = 0; j < 10; j++){
				System.out.print(" " + intArray4[i][j]);
			}
			System.out.println();
		} for(int j = 0; j < 10; j++){
				System.out.print(" " + intArray4[i][j]);
			} int j = 0; int j = 0; j 0 j < 10 j 10 j++ j++ j {
				System.out.print(" " + intArray4[i][j]);
			} {
				System.out.print(" " + intArray4[i][j]);
			} System.out.print(" " + intArray4[i][j]) System.out.print System.out System System.out " " + intArray4[i][j] " " intArray4[i][j] intArray4[i] intArray4 i j System.out.println() System.out.println System.out System System.out scan.close() scan.close scan String[] args args public class Main{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int intNum = scan.nextInt();
		int b;
		int f;
		int r;
		int v;
		int[][] intArray1 = new int[3][10];
		int[][] intArray2 = new int[3][10];
		int[][] intArray3 = new int[3][10];
		int[][] intArray4 = new int[3][10];

		for(int i = 0; i < intNum; i++){
			b = scan.nextInt();
			f = scan.nextInt();
			r = scan.nextInt();
			v = scan.nextInt();
			if(b == 1){
				intArray1[f-1][r-1] = intArray1[f-1][r-1] += v;
			}else if(b == 2){
				intArray2[f-1][r-1] = intArray2[f-1][r-1] + v;
			}else if(b == 3){
				intArray3[f-1][r-1] = intArray3[f-1][r-1] + v;
			}else if(b == 4){
				intArray4[f-1][r-1] = intArray4[f-1][r-1] + v;
			}
		}

		for(int i = 0; i < 3; i++){
			for(int j = 0; j < 10; j++){
				System.out.print(" " + intArray1[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(" " + intArray2[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(" " + intArray3[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(" " + intArray4[i][j]);
			}
			System.out.println();
		}
		scan.close();
	}
} public class Main{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int intNum = scan.nextInt();
		int b;
		int f;
		int r;
		int v;
		int[][] intArray1 = new int[3][10];
		int[][] intArray2 = new int[3][10];
		int[][] intArray3 = new int[3][10];
		int[][] intArray4 = new int[3][10];

		for(int i = 0; i < intNum; i++){
			b = scan.nextInt();
			f = scan.nextInt();
			r = scan.nextInt();
			v = scan.nextInt();
			if(b == 1){
				intArray1[f-1][r-1] = intArray1[f-1][r-1] += v;
			}else if(b == 2){
				intArray2[f-1][r-1] = intArray2[f-1][r-1] + v;
			}else if(b == 3){
				intArray3[f-1][r-1] = intArray3[f-1][r-1] + v;
			}else if(b == 4){
				intArray4[f-1][r-1] = intArray4[f-1][r-1] + v;
			}
		}

		for(int i = 0; i < 3; i++){
			for(int j = 0; j < 10; j++){
				System.out.print(" " + intArray1[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(" " + intArray2[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(" " + intArray3[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(" " + intArray4[i][j]);
			}
			System.out.println();
		}
		scan.close();
	}
} Main
import java.util.Scanner;

public class Main{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int intNum = scan.nextInt();
		int b;
		int f;
		int r;
		int v;
		int[][] intArray1 = new int[3][10];
		int[][] intArray2 = new int[3][10];
		int[][] intArray3 = new int[3][10];
		int[][] intArray4 = new int[3][10];

		for(int i = 0; i < intNum; i++){
			b = scan.nextInt();
			f = scan.nextInt();
			r = scan.nextInt();
			v = scan.nextInt();
			if(b == 1){
				intArray1[f-1][r-1] = intArray1[f-1][r-1] += v;
			}else if(b == 2){
				intArray2[f-1][r-1] = intArray2[f-1][r-1] + v;
			}else if(b == 3){
				intArray3[f-1][r-1] = intArray3[f-1][r-1] + v;
			}else if(b == 4){
				intArray4[f-1][r-1] = intArray4[f-1][r-1] + v;
			}
		}

		for(int i = 0; i < 3; i++){
			for(int j = 0; j < 10; j++){
				System.out.print(" " + intArray1[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(" " + intArray2[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(" " + intArray3[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(" " + intArray4[i][j]);
			}
			System.out.println();
		}
		scan.close();
	}
}