
import java.util.Scanner;

public class Main{
	public static void main(String args[]){

		//???????????£?¨??????????
		int house [][][];
		house = new int[4][3][10];//b?£?f??????r??????v???

		//????????°????????????????????????????????????
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();

		for(int h = 0; h < n ; h++){

			int b = sc.nextInt();
			int f = sc.nextInt();
			int r = sc.nextInt();
			int v = sc.nextInt();


			house[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(" " + house[i][j][k]);
				}
				System.out.println("");
			}
			if(i != 3){
				System.out.println("####################");
			}
		}
		sc.close();
	}
} import java.util.Scanner; Scanner java.util public class Main{
	public static void main(String args[]){

		//???????????£?¨??????????
		int house [][][];
		house = new int[4][3][10];//b?£?f??????r??????v???

		//????????°????????????????????????????????????
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();

		for(int h = 0; h < n ; h++){

			int b = sc.nextInt();
			int f = sc.nextInt();
			int r = sc.nextInt();
			int v = sc.nextInt();


			house[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(" " + house[i][j][k]);
				}
				System.out.println("");
			}
			if(i != 3){
				System.out.println("####################");
			}
		}
		sc.close();
	}
} Main public static void main(String args[]){

		//???????????£?¨??????????
		int house [][][];
		house = new int[4][3][10];//b?£?f??????r??????v???

		//????????°????????????????????????????????????
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();

		for(int h = 0; h < n ; h++){

			int b = sc.nextInt();
			int f = sc.nextInt();
			int r = sc.nextInt();
			int v = sc.nextInt();


			house[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(" " + house[i][j][k]);
				}
				System.out.println("");
			}
			if(i != 3){
				System.out.println("####################");
			}
		}
		sc.close();
	} main {

		//???????????£?¨??????????
		int house [][][];
		house = new int[4][3][10];//b?£?f??????r??????v???

		//????????°????????????????????????????????????
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();

		for(int h = 0; h < n ; h++){

			int b = sc.nextInt();
			int f = sc.nextInt();
			int r = sc.nextInt();
			int v = sc.nextInt();


			house[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(" " + house[i][j][k]);
				}
				System.out.println("");
			}
			if(i != 3){
				System.out.println("####################");
			}
		}
		sc.close();
	} int house [][][]; house house = new int[4][3][10] house new int[4][3][10] 4 3 10 Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc for(int h = 0; h < n ; h++){

			int b = sc.nextInt();
			int f = sc.nextInt();
			int r = sc.nextInt();
			int v = sc.nextInt();


			house[b-1][f-1][r-1] += v;
		} int h = 0; int h = 0; h 0 h < n h n h++ h++ h {

			int b = sc.nextInt();
			int f = sc.nextInt();
			int r = sc.nextInt();
			int v = sc.nextInt();


			house[b-1][f-1][r-1] += v;
		} {

			int b = sc.nextInt();
			int f = sc.nextInt();
			int r = sc.nextInt();
			int v = sc.nextInt();


			house[b-1][f-1][r-1] += v;
		} 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 house[b-1][f-1][r-1] += v house[b-1][f-1][r-1] house[b-1][f-1] house[b-1] house 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(" " + house[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(" " + house[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(" " + house[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(" " + house[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(" " + house[i][j][k]);
				}
				System.out.println("");
			} {
				for(int k = 0; k < 10; k++){
					System.out.print(" " + house[i][j][k]);
				}
				System.out.println("");
			} for(int k = 0; k < 10; k++){
					System.out.print(" " + house[i][j][k]);
				} int k = 0; int k = 0; k 0 k < 10 k 10 k++ k++ k {
					System.out.print(" " + house[i][j][k]);
				} {
					System.out.print(" " + house[i][j][k]);
				} System.out.print(" " + house[i][j][k]) System.out.print System.out System System.out " " + house[i][j][k] " " house[i][j][k] house[i][j] house[i] house 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.println System.out System System.out "####################" sc.close() sc.close sc String args[] args public class Main{
	public static void main(String args[]){

		//???????????£?¨??????????
		int house [][][];
		house = new int[4][3][10];//b?£?f??????r??????v???

		//????????°????????????????????????????????????
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();

		for(int h = 0; h < n ; h++){

			int b = sc.nextInt();
			int f = sc.nextInt();
			int r = sc.nextInt();
			int v = sc.nextInt();


			house[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(" " + house[i][j][k]);
				}
				System.out.println("");
			}
			if(i != 3){
				System.out.println("####################");
			}
		}
		sc.close();
	}
} public class Main{
	public static void main(String args[]){

		//???????????£?¨??????????
		int house [][][];
		house = new int[4][3][10];//b?£?f??????r??????v???

		//????????°????????????????????????????????????
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();

		for(int h = 0; h < n ; h++){

			int b = sc.nextInt();
			int f = sc.nextInt();
			int r = sc.nextInt();
			int v = sc.nextInt();


			house[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(" " + house[i][j][k]);
				}
				System.out.println("");
			}
			if(i != 3){
				System.out.println("####################");
			}
		}
		sc.close();
	}
} Main

import java.util.Scanner;

public class Main{
	public static void main(String args[]){

		//???????????£?¨??????????
		int house [][][];
		house = new int[4][3][10];//b?£?f??????r??????v???

		//????????°????????????????????????????????????
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();

		for(int h = 0; h < n ; h++){

			int b = sc.nextInt();
			int f = sc.nextInt();
			int r = sc.nextInt();
			int v = sc.nextInt();


			house[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(" " + house[i][j][k]);
				}
				System.out.println("");
			}
			if(i != 3){
				System.out.println("####################");
			}
		}
		sc.close();
	}
}