import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

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

		int su1[][] = new int [3][10];
		int su2[][] = new int [3][10];
		int su3[][] = new int [3][10];
		int su4[][] = new int [3][10];

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int count = Integer.parseInt(br.readLine());

		int bill = 0;
		int floor = 0;
		int room = 0;
		int person = 0;

		for(int i = 0; i < count; i++){
			String str = br.readLine();
			String[] s = str.split(" ");

			bill = Integer.parseInt(s[0]);
			floor = Integer.parseInt(s[1]);
			room = Integer.parseInt(s[2]);
			person = Integer.parseInt(s[3]);


			if(bill == 1){
				su1[floor - 1][room - 1] += (person);
			}else if(bill == 2){
				su2[floor - 1][room - 1] += (person);
			}else if(bill == 3){
				su3[floor - 1][room - 1] += (person);
			}else if(bill == 4){
				su4[floor - 1][room - 1] += (person);
			}
		}
		for(int i = 0; i < 3; i++){
			for(int j = 0; j < 10; j++){
				System.out.print(" "+su1[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(" "+su2[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(" "+su3[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(" "+su4[i][j]);
			}
			System.out.println();
		}
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {
	public static void main(String[] args)throws IOException{

		int su1[][] = new int [3][10];
		int su2[][] = new int [3][10];
		int su3[][] = new int [3][10];
		int su4[][] = new int [3][10];

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int count = Integer.parseInt(br.readLine());

		int bill = 0;
		int floor = 0;
		int room = 0;
		int person = 0;

		for(int i = 0; i < count; i++){
			String str = br.readLine();
			String[] s = str.split(" ");

			bill = Integer.parseInt(s[0]);
			floor = Integer.parseInt(s[1]);
			room = Integer.parseInt(s[2]);
			person = Integer.parseInt(s[3]);


			if(bill == 1){
				su1[floor - 1][room - 1] += (person);
			}else if(bill == 2){
				su2[floor - 1][room - 1] += (person);
			}else if(bill == 3){
				su3[floor - 1][room - 1] += (person);
			}else if(bill == 4){
				su4[floor - 1][room - 1] += (person);
			}
		}
		for(int i = 0; i < 3; i++){
			for(int j = 0; j < 10; j++){
				System.out.print(" "+su1[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(" "+su2[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(" "+su3[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(" "+su4[i][j]);
			}
			System.out.println();
		}
	}
} Main public static void main(String[] args)throws IOException{

		int su1[][] = new int [3][10];
		int su2[][] = new int [3][10];
		int su3[][] = new int [3][10];
		int su4[][] = new int [3][10];

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int count = Integer.parseInt(br.readLine());

		int bill = 0;
		int floor = 0;
		int room = 0;
		int person = 0;

		for(int i = 0; i < count; i++){
			String str = br.readLine();
			String[] s = str.split(" ");

			bill = Integer.parseInt(s[0]);
			floor = Integer.parseInt(s[1]);
			room = Integer.parseInt(s[2]);
			person = Integer.parseInt(s[3]);


			if(bill == 1){
				su1[floor - 1][room - 1] += (person);
			}else if(bill == 2){
				su2[floor - 1][room - 1] += (person);
			}else if(bill == 3){
				su3[floor - 1][room - 1] += (person);
			}else if(bill == 4){
				su4[floor - 1][room - 1] += (person);
			}
		}
		for(int i = 0; i < 3; i++){
			for(int j = 0; j < 10; j++){
				System.out.print(" "+su1[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(" "+su2[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(" "+su3[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(" "+su4[i][j]);
			}
			System.out.println();
		}
	} main {

		int su1[][] = new int [3][10];
		int su2[][] = new int [3][10];
		int su3[][] = new int [3][10];
		int su4[][] = new int [3][10];

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int count = Integer.parseInt(br.readLine());

		int bill = 0;
		int floor = 0;
		int room = 0;
		int person = 0;

		for(int i = 0; i < count; i++){
			String str = br.readLine();
			String[] s = str.split(" ");

			bill = Integer.parseInt(s[0]);
			floor = Integer.parseInt(s[1]);
			room = Integer.parseInt(s[2]);
			person = Integer.parseInt(s[3]);


			if(bill == 1){
				su1[floor - 1][room - 1] += (person);
			}else if(bill == 2){
				su2[floor - 1][room - 1] += (person);
			}else if(bill == 3){
				su3[floor - 1][room - 1] += (person);
			}else if(bill == 4){
				su4[floor - 1][room - 1] += (person);
			}
		}
		for(int i = 0; i < 3; i++){
			for(int j = 0; j < 10; j++){
				System.out.print(" "+su1[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(" "+su2[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(" "+su3[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(" "+su4[i][j]);
			}
			System.out.println();
		}
	} int su1[][] = new int [3][10]; su1 new int [3][10] 3 10 int su2[][] = new int [3][10]; su2 new int [3][10] 3 10 int su3[][] = new int [3][10]; su3 new int [3][10] 3 10 int su4[][] = new int [3][10]; su4 new int [3][10] 3 10 BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) int count = Integer.parseInt(br.readLine()); count Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br int bill = 0; bill 0 int floor = 0; floor 0 int room = 0; room 0 int person = 0; person 0 for(int i = 0; i < count; i++){
			String str = br.readLine();
			String[] s = str.split(" ");

			bill = Integer.parseInt(s[0]);
			floor = Integer.parseInt(s[1]);
			room = Integer.parseInt(s[2]);
			person = Integer.parseInt(s[3]);


			if(bill == 1){
				su1[floor - 1][room - 1] += (person);
			}else if(bill == 2){
				su2[floor - 1][room - 1] += (person);
			}else if(bill == 3){
				su3[floor - 1][room - 1] += (person);
			}else if(bill == 4){
				su4[floor - 1][room - 1] += (person);
			}
		} int i = 0; int i = 0; i 0 i < count i count i++ i++ i {
			String str = br.readLine();
			String[] s = str.split(" ");

			bill = Integer.parseInt(s[0]);
			floor = Integer.parseInt(s[1]);
			room = Integer.parseInt(s[2]);
			person = Integer.parseInt(s[3]);


			if(bill == 1){
				su1[floor - 1][room - 1] += (person);
			}else if(bill == 2){
				su2[floor - 1][room - 1] += (person);
			}else if(bill == 3){
				su3[floor - 1][room - 1] += (person);
			}else if(bill == 4){
				su4[floor - 1][room - 1] += (person);
			}
		} {
			String str = br.readLine();
			String[] s = str.split(" ");

			bill = Integer.parseInt(s[0]);
			floor = Integer.parseInt(s[1]);
			room = Integer.parseInt(s[2]);
			person = Integer.parseInt(s[3]);


			if(bill == 1){
				su1[floor - 1][room - 1] += (person);
			}else if(bill == 2){
				su2[floor - 1][room - 1] += (person);
			}else if(bill == 3){
				su3[floor - 1][room - 1] += (person);
			}else if(bill == 4){
				su4[floor - 1][room - 1] += (person);
			}
		} String str = br.readLine(); str br.readLine() br.readLine br String[] s = str.split(" "); s str.split(" ") str.split str " " bill = Integer.parseInt(s[0]) bill Integer.parseInt(s[0]) Integer.parseInt Integer s[0] s 0 floor = Integer.parseInt(s[1]) floor Integer.parseInt(s[1]) Integer.parseInt Integer s[1] s 1 room = Integer.parseInt(s[2]) room Integer.parseInt(s[2]) Integer.parseInt Integer s[2] s 2 person = Integer.parseInt(s[3]) person Integer.parseInt(s[3]) Integer.parseInt Integer s[3] s 3 if(bill == 1){
				su1[floor - 1][room - 1] += (person);
			}else if(bill == 2){
				su2[floor - 1][room - 1] += (person);
			}else if(bill == 3){
				su3[floor - 1][room - 1] += (person);
			}else if(bill == 4){
				su4[floor - 1][room - 1] += (person);
			} bill == 1 bill 1 {
				su1[floor - 1][room - 1] += (person);
			} su1[floor - 1][room - 1] += (person) su1[floor - 1][room - 1] su1[floor - 1] su1 floor - 1 floor 1 room - 1 room 1 (person) if(bill == 2){
				su2[floor - 1][room - 1] += (person);
			}else if(bill == 3){
				su3[floor - 1][room - 1] += (person);
			}else if(bill == 4){
				su4[floor - 1][room - 1] += (person);
			} bill == 2 bill 2 {
				su2[floor - 1][room - 1] += (person);
			} su2[floor - 1][room - 1] += (person) su2[floor - 1][room - 1] su2[floor - 1] su2 floor - 1 floor 1 room - 1 room 1 (person) if(bill == 3){
				su3[floor - 1][room - 1] += (person);
			}else if(bill == 4){
				su4[floor - 1][room - 1] += (person);
			} bill == 3 bill 3 {
				su3[floor - 1][room - 1] += (person);
			} su3[floor - 1][room - 1] += (person) su3[floor - 1][room - 1] su3[floor - 1] su3 floor - 1 floor 1 room - 1 room 1 (person) if(bill == 4){
				su4[floor - 1][room - 1] += (person);
			} bill == 4 bill 4 {
				su4[floor - 1][room - 1] += (person);
			} su4[floor - 1][room - 1] += (person) su4[floor - 1][room - 1] su4[floor - 1] su4 floor - 1 floor 1 room - 1 room 1 (person) for(int i = 0; i < 3; i++){
			for(int j = 0; j < 10; j++){
				System.out.print(" "+su1[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(" "+su1[i][j]);
			}
			System.out.println();
		} {
			for(int j = 0; j < 10; j++){
				System.out.print(" "+su1[i][j]);
			}
			System.out.println();
		} for(int j = 0; j < 10; j++){
				System.out.print(" "+su1[i][j]);
			} int j = 0; int j = 0; j 0 j < 10 j 10 j++ j++ j {
				System.out.print(" "+su1[i][j]);
			} {
				System.out.print(" "+su1[i][j]);
			} System.out.print(" "+su1[i][j]) System.out.print System.out System System.out " "+su1[i][j] " " su1[i][j] su1[i] su1 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(" "+su2[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(" "+su2[i][j]);
			}
			System.out.println();
		} {
			for(int j = 0; j < 10; j++){
				System.out.print(" "+su2[i][j]);
			}
			System.out.println();
		} for(int j = 0; j < 10; j++){
				System.out.print(" "+su2[i][j]);
			} int j = 0; int j = 0; j 0 j < 10 j 10 j++ j++ j {
				System.out.print(" "+su2[i][j]);
			} {
				System.out.print(" "+su2[i][j]);
			} System.out.print(" "+su2[i][j]) System.out.print System.out System System.out " "+su2[i][j] " " su2[i][j] su2[i] su2 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(" "+su3[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(" "+su3[i][j]);
			}
			System.out.println();
		} {
			for(int j = 0; j < 10; j++){
				System.out.print(" "+su3[i][j]);
			}
			System.out.println();
		} for(int j = 0; j < 10; j++){
				System.out.print(" "+su3[i][j]);
			} int j = 0; int j = 0; j 0 j < 10 j 10 j++ j++ j {
				System.out.print(" "+su3[i][j]);
			} {
				System.out.print(" "+su3[i][j]);
			} System.out.print(" "+su3[i][j]) System.out.print System.out System System.out " "+su3[i][j] " " su3[i][j] su3[i] su3 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(" "+su4[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(" "+su4[i][j]);
			}
			System.out.println();
		} {
			for(int j = 0; j < 10; j++){
				System.out.print(" "+su4[i][j]);
			}
			System.out.println();
		} for(int j = 0; j < 10; j++){
				System.out.print(" "+su4[i][j]);
			} int j = 0; int j = 0; j 0 j < 10 j 10 j++ j++ j {
				System.out.print(" "+su4[i][j]);
			} {
				System.out.print(" "+su4[i][j]);
			} System.out.print(" "+su4[i][j]) System.out.print System.out System System.out " "+su4[i][j] " " su4[i][j] su4[i] su4 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)throws IOException{

		int su1[][] = new int [3][10];
		int su2[][] = new int [3][10];
		int su3[][] = new int [3][10];
		int su4[][] = new int [3][10];

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int count = Integer.parseInt(br.readLine());

		int bill = 0;
		int floor = 0;
		int room = 0;
		int person = 0;

		for(int i = 0; i < count; i++){
			String str = br.readLine();
			String[] s = str.split(" ");

			bill = Integer.parseInt(s[0]);
			floor = Integer.parseInt(s[1]);
			room = Integer.parseInt(s[2]);
			person = Integer.parseInt(s[3]);


			if(bill == 1){
				su1[floor - 1][room - 1] += (person);
			}else if(bill == 2){
				su2[floor - 1][room - 1] += (person);
			}else if(bill == 3){
				su3[floor - 1][room - 1] += (person);
			}else if(bill == 4){
				su4[floor - 1][room - 1] += (person);
			}
		}
		for(int i = 0; i < 3; i++){
			for(int j = 0; j < 10; j++){
				System.out.print(" "+su1[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(" "+su2[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(" "+su3[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(" "+su4[i][j]);
			}
			System.out.println();
		}
	}
} public class Main {
	public static void main(String[] args)throws IOException{

		int su1[][] = new int [3][10];
		int su2[][] = new int [3][10];
		int su3[][] = new int [3][10];
		int su4[][] = new int [3][10];

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int count = Integer.parseInt(br.readLine());

		int bill = 0;
		int floor = 0;
		int room = 0;
		int person = 0;

		for(int i = 0; i < count; i++){
			String str = br.readLine();
			String[] s = str.split(" ");

			bill = Integer.parseInt(s[0]);
			floor = Integer.parseInt(s[1]);
			room = Integer.parseInt(s[2]);
			person = Integer.parseInt(s[3]);


			if(bill == 1){
				su1[floor - 1][room - 1] += (person);
			}else if(bill == 2){
				su2[floor - 1][room - 1] += (person);
			}else if(bill == 3){
				su3[floor - 1][room - 1] += (person);
			}else if(bill == 4){
				su4[floor - 1][room - 1] += (person);
			}
		}
		for(int i = 0; i < 3; i++){
			for(int j = 0; j < 10; j++){
				System.out.print(" "+su1[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(" "+su2[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(" "+su3[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(" "+su4[i][j]);
			}
			System.out.println();
		}
	}
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

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

		int su1[][] = new int [3][10];
		int su2[][] = new int [3][10];
		int su3[][] = new int [3][10];
		int su4[][] = new int [3][10];

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int count = Integer.parseInt(br.readLine());

		int bill = 0;
		int floor = 0;
		int room = 0;
		int person = 0;

		for(int i = 0; i < count; i++){
			String str = br.readLine();
			String[] s = str.split(" ");

			bill = Integer.parseInt(s[0]);
			floor = Integer.parseInt(s[1]);
			room = Integer.parseInt(s[2]);
			person = Integer.parseInt(s[3]);


			if(bill == 1){
				su1[floor - 1][room - 1] += (person);
			}else if(bill == 2){
				su2[floor - 1][room - 1] += (person);
			}else if(bill == 3){
				su3[floor - 1][room - 1] += (person);
			}else if(bill == 4){
				su4[floor - 1][room - 1] += (person);
			}
		}
		for(int i = 0; i < 3; i++){
			for(int j = 0; j < 10; j++){
				System.out.print(" "+su1[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(" "+su2[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(" "+su3[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(" "+su4[i][j]);
			}
			System.out.println();
		}
	}
}