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

public class Main {
	private static final String BR = System.getProperty("line.separator");
	public static void main(String[] args) {
		try {
			BufferedReader br = new BufferedReader(new InputStreamReader(
					System.in));
			StringBuilder sb = new StringBuilder();

			int[][] house = new int[12][10];

			for (int[] rooms : house) {
				for (int room : rooms) {
					room = 0;
				}
			}

			int n = Integer.parseInt(br.readLine());
			String[] strs;

			for (int i = 0; i < n; i++) {
				strs = br.readLine().split("\\s");
				house[(Integer.parseInt(strs[0]) - 1) * 3
						+ Integer.parseInt(strs[1]) - 1][Integer
						.parseInt(strs[2]) - 1] += Integer.parseInt(strs[3]);
			}

			for (int i = 0; i < house.length; i++) {
				for (int j = 0; j < house[i].length; j++) {
					if (j != 0 || j != house[i].length - 1)
						sb.append(" " + house[i][j]);
				}
				sb.append(BR);
				if (i != 0 && i != house.length - 1 && (i + 1) % 3 == 0)
					sb.append("####################" + BR);
			}
			System.out.print(sb);
			br.close();
		} catch (Exception e) {
			System.err.println(e);
		}
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {
	private static final String BR = System.getProperty("line.separator");
	public static void main(String[] args) {
		try {
			BufferedReader br = new BufferedReader(new InputStreamReader(
					System.in));
			StringBuilder sb = new StringBuilder();

			int[][] house = new int[12][10];

			for (int[] rooms : house) {
				for (int room : rooms) {
					room = 0;
				}
			}

			int n = Integer.parseInt(br.readLine());
			String[] strs;

			for (int i = 0; i < n; i++) {
				strs = br.readLine().split("\\s");
				house[(Integer.parseInt(strs[0]) - 1) * 3
						+ Integer.parseInt(strs[1]) - 1][Integer
						.parseInt(strs[2]) - 1] += Integer.parseInt(strs[3]);
			}

			for (int i = 0; i < house.length; i++) {
				for (int j = 0; j < house[i].length; j++) {
					if (j != 0 || j != house[i].length - 1)
						sb.append(" " + house[i][j]);
				}
				sb.append(BR);
				if (i != 0 && i != house.length - 1 && (i + 1) % 3 == 0)
					sb.append("####################" + BR);
			}
			System.out.print(sb);
			br.close();
		} catch (Exception e) {
			System.err.println(e);
		}
	}
} Main private static final String BR = System.getProperty("line.separator"); BR System.getProperty("line.separator") System.getProperty System "line.separator" public static void main(String[] args) {
		try {
			BufferedReader br = new BufferedReader(new InputStreamReader(
					System.in));
			StringBuilder sb = new StringBuilder();

			int[][] house = new int[12][10];

			for (int[] rooms : house) {
				for (int room : rooms) {
					room = 0;
				}
			}

			int n = Integer.parseInt(br.readLine());
			String[] strs;

			for (int i = 0; i < n; i++) {
				strs = br.readLine().split("\\s");
				house[(Integer.parseInt(strs[0]) - 1) * 3
						+ Integer.parseInt(strs[1]) - 1][Integer
						.parseInt(strs[2]) - 1] += Integer.parseInt(strs[3]);
			}

			for (int i = 0; i < house.length; i++) {
				for (int j = 0; j < house[i].length; j++) {
					if (j != 0 || j != house[i].length - 1)
						sb.append(" " + house[i][j]);
				}
				sb.append(BR);
				if (i != 0 && i != house.length - 1 && (i + 1) % 3 == 0)
					sb.append("####################" + BR);
			}
			System.out.print(sb);
			br.close();
		} catch (Exception e) {
			System.err.println(e);
		}
	} main {
		try {
			BufferedReader br = new BufferedReader(new InputStreamReader(
					System.in));
			StringBuilder sb = new StringBuilder();

			int[][] house = new int[12][10];

			for (int[] rooms : house) {
				for (int room : rooms) {
					room = 0;
				}
			}

			int n = Integer.parseInt(br.readLine());
			String[] strs;

			for (int i = 0; i < n; i++) {
				strs = br.readLine().split("\\s");
				house[(Integer.parseInt(strs[0]) - 1) * 3
						+ Integer.parseInt(strs[1]) - 1][Integer
						.parseInt(strs[2]) - 1] += Integer.parseInt(strs[3]);
			}

			for (int i = 0; i < house.length; i++) {
				for (int j = 0; j < house[i].length; j++) {
					if (j != 0 || j != house[i].length - 1)
						sb.append(" " + house[i][j]);
				}
				sb.append(BR);
				if (i != 0 && i != house.length - 1 && (i + 1) % 3 == 0)
					sb.append("####################" + BR);
			}
			System.out.print(sb);
			br.close();
		} catch (Exception e) {
			System.err.println(e);
		}
	} try {
			BufferedReader br = new BufferedReader(new InputStreamReader(
					System.in));
			StringBuilder sb = new StringBuilder();

			int[][] house = new int[12][10];

			for (int[] rooms : house) {
				for (int room : rooms) {
					room = 0;
				}
			}

			int n = Integer.parseInt(br.readLine());
			String[] strs;

			for (int i = 0; i < n; i++) {
				strs = br.readLine().split("\\s");
				house[(Integer.parseInt(strs[0]) - 1) * 3
						+ Integer.parseInt(strs[1]) - 1][Integer
						.parseInt(strs[2]) - 1] += Integer.parseInt(strs[3]);
			}

			for (int i = 0; i < house.length; i++) {
				for (int j = 0; j < house[i].length; j++) {
					if (j != 0 || j != house[i].length - 1)
						sb.append(" " + house[i][j]);
				}
				sb.append(BR);
				if (i != 0 && i != house.length - 1 && (i + 1) % 3 == 0)
					sb.append("####################" + BR);
			}
			System.out.print(sb);
			br.close();
		} catch (Exception e) {
			System.err.println(e);
		} catch (Exception e) {
			System.err.println(e);
		} Exception e {
			System.err.println(e);
		} System.err.println(e) System.err.println System.err System System.err e {
			BufferedReader br = new BufferedReader(new InputStreamReader(
					System.in));
			StringBuilder sb = new StringBuilder();

			int[][] house = new int[12][10];

			for (int[] rooms : house) {
				for (int room : rooms) {
					room = 0;
				}
			}

			int n = Integer.parseInt(br.readLine());
			String[] strs;

			for (int i = 0; i < n; i++) {
				strs = br.readLine().split("\\s");
				house[(Integer.parseInt(strs[0]) - 1) * 3
						+ Integer.parseInt(strs[1]) - 1][Integer
						.parseInt(strs[2]) - 1] += Integer.parseInt(strs[3]);
			}

			for (int i = 0; i < house.length; i++) {
				for (int j = 0; j < house[i].length; j++) {
					if (j != 0 || j != house[i].length - 1)
						sb.append(" " + house[i][j]);
				}
				sb.append(BR);
				if (i != 0 && i != house.length - 1 && (i + 1) % 3 == 0)
					sb.append("####################" + BR);
			}
			System.out.print(sb);
			br.close();
		} BufferedReader br = new BufferedReader(new InputStreamReader(
					System.in)); br new BufferedReader(new InputStreamReader(
					System.in)) StringBuilder sb = new StringBuilder(); sb new StringBuilder() int[][] house = new int[12][10]; house new int[12][10] 12 10 for (int[] rooms : house) {
				for (int room : rooms) {
					room = 0;
				}
			} int[] rooms house {
				for (int room : rooms) {
					room = 0;
				}
			} {
				for (int room : rooms) {
					room = 0;
				}
			} for (int room : rooms) {
					room = 0;
				} int room rooms {
					room = 0;
				} {
					room = 0;
				} room = 0 room 0 int n = Integer.parseInt(br.readLine()); n Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br String[] strs; strs for (int i = 0; i < n; i++) {
				strs = br.readLine().split("\\s");
				house[(Integer.parseInt(strs[0]) - 1) * 3
						+ Integer.parseInt(strs[1]) - 1][Integer
						.parseInt(strs[2]) - 1] += Integer.parseInt(strs[3]);
			} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
				strs = br.readLine().split("\\s");
				house[(Integer.parseInt(strs[0]) - 1) * 3
						+ Integer.parseInt(strs[1]) - 1][Integer
						.parseInt(strs[2]) - 1] += Integer.parseInt(strs[3]);
			} {
				strs = br.readLine().split("\\s");
				house[(Integer.parseInt(strs[0]) - 1) * 3
						+ Integer.parseInt(strs[1]) - 1][Integer
						.parseInt(strs[2]) - 1] += Integer.parseInt(strs[3]);
			} strs = br.readLine().split("\\s") strs br.readLine().split("\\s") br.readLine().split br.readLine() br.readLine br "\\s" house[(Integer.parseInt(strs[0]) - 1) * 3
						+ Integer.parseInt(strs[1]) - 1][Integer
						.parseInt(strs[2]) - 1] += Integer.parseInt(strs[3]) house[(Integer.parseInt(strs[0]) - 1) * 3
						+ Integer.parseInt(strs[1]) - 1][Integer
						.parseInt(strs[2]) - 1] house[(Integer.parseInt(strs[0]) - 1) * 3
						+ Integer.parseInt(strs[1]) - 1] house (Integer.parseInt(strs[0]) - 1) * 3
						+ Integer.parseInt(strs[1]) - 1 (Integer.parseInt(strs[0]) - 1) * 3
						+ Integer.parseInt(strs[1]) (Integer.parseInt(strs[0]) - 1) * 3 (Integer.parseInt(strs[0]) - 1) Integer.parseInt(strs[0]) Integer.parseInt Integer strs[0] strs 0 1 3 Integer.parseInt(strs[1]) Integer.parseInt Integer strs[1] strs 1 1 Integer
						.parseInt(strs[2]) - 1 Integer
						.parseInt(strs[2]) Integer
						.parseInt Integer strs[2] strs 2 1 Integer.parseInt(strs[3]) Integer.parseInt Integer strs[3] strs 3 for (int i = 0; i < house.length; i++) {
				for (int j = 0; j < house[i].length; j++) {
					if (j != 0 || j != house[i].length - 1)
						sb.append(" " + house[i][j]);
				}
				sb.append(BR);
				if (i != 0 && i != house.length - 1 && (i + 1) % 3 == 0)
					sb.append("####################" + BR);
			} int i = 0; int i = 0; i 0 i < house.length i house.length house house.length i++ i++ i {
				for (int j = 0; j < house[i].length; j++) {
					if (j != 0 || j != house[i].length - 1)
						sb.append(" " + house[i][j]);
				}
				sb.append(BR);
				if (i != 0 && i != house.length - 1 && (i + 1) % 3 == 0)
					sb.append("####################" + BR);
			} {
				for (int j = 0; j < house[i].length; j++) {
					if (j != 0 || j != house[i].length - 1)
						sb.append(" " + house[i][j]);
				}
				sb.append(BR);
				if (i != 0 && i != house.length - 1 && (i + 1) % 3 == 0)
					sb.append("####################" + BR);
			} for (int j = 0; j < house[i].length; j++) {
					if (j != 0 || j != house[i].length - 1)
						sb.append(" " + house[i][j]);
				} int j = 0; int j = 0; j 0 j < house[i].length j house[i].length house[i] house i house[i].length j++ j++ j {
					if (j != 0 || j != house[i].length - 1)
						sb.append(" " + house[i][j]);
				} {
					if (j != 0 || j != house[i].length - 1)
						sb.append(" " + house[i][j]);
				} if (j != 0 || j != house[i].length - 1)
						sb.append(" " + house[i][j]); j != 0 || j != house[i].length - 1 j != 0 j 0 j != house[i].length - 1 j house[i].length - 1 house[i].length house[i] house i house[i].length 1 sb.append(" " + house[i][j]) sb.append sb " " + house[i][j] " " house[i][j] house[i] house i j sb.append(BR) sb.append sb BR if (i != 0 && i != house.length - 1 && (i + 1) % 3 == 0)
					sb.append("####################" + BR); i != 0 && i != house.length - 1 && (i + 1) % 3 == 0 i != 0 && i != house.length - 1 && (i + 1) % 3 == 0 i != 0 i 0 i != house.length - 1 i house.length - 1 house.length house house.length 1 (i + 1) % 3 == 0 (i + 1) % 3 (i + 1) i 1 3 0 sb.append("####################" + BR) sb.append sb "####################" + BR "####################" BR System.out.print(sb) System.out.print System.out System System.out sb br.close() br.close br String[] args args public class Main {
	private static final String BR = System.getProperty("line.separator");
	public static void main(String[] args) {
		try {
			BufferedReader br = new BufferedReader(new InputStreamReader(
					System.in));
			StringBuilder sb = new StringBuilder();

			int[][] house = new int[12][10];

			for (int[] rooms : house) {
				for (int room : rooms) {
					room = 0;
				}
			}

			int n = Integer.parseInt(br.readLine());
			String[] strs;

			for (int i = 0; i < n; i++) {
				strs = br.readLine().split("\\s");
				house[(Integer.parseInt(strs[0]) - 1) * 3
						+ Integer.parseInt(strs[1]) - 1][Integer
						.parseInt(strs[2]) - 1] += Integer.parseInt(strs[3]);
			}

			for (int i = 0; i < house.length; i++) {
				for (int j = 0; j < house[i].length; j++) {
					if (j != 0 || j != house[i].length - 1)
						sb.append(" " + house[i][j]);
				}
				sb.append(BR);
				if (i != 0 && i != house.length - 1 && (i + 1) % 3 == 0)
					sb.append("####################" + BR);
			}
			System.out.print(sb);
			br.close();
		} catch (Exception e) {
			System.err.println(e);
		}
	}
} public class Main {
	private static final String BR = System.getProperty("line.separator");
	public static void main(String[] args) {
		try {
			BufferedReader br = new BufferedReader(new InputStreamReader(
					System.in));
			StringBuilder sb = new StringBuilder();

			int[][] house = new int[12][10];

			for (int[] rooms : house) {
				for (int room : rooms) {
					room = 0;
				}
			}

			int n = Integer.parseInt(br.readLine());
			String[] strs;

			for (int i = 0; i < n; i++) {
				strs = br.readLine().split("\\s");
				house[(Integer.parseInt(strs[0]) - 1) * 3
						+ Integer.parseInt(strs[1]) - 1][Integer
						.parseInt(strs[2]) - 1] += Integer.parseInt(strs[3]);
			}

			for (int i = 0; i < house.length; i++) {
				for (int j = 0; j < house[i].length; j++) {
					if (j != 0 || j != house[i].length - 1)
						sb.append(" " + house[i][j]);
				}
				sb.append(BR);
				if (i != 0 && i != house.length - 1 && (i + 1) % 3 == 0)
					sb.append("####################" + BR);
			}
			System.out.print(sb);
			br.close();
		} catch (Exception e) {
			System.err.println(e);
		}
	}
} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {
	private static final String BR = System.getProperty("line.separator");
	public static void main(String[] args) {
		try {
			BufferedReader br = new BufferedReader(new InputStreamReader(
					System.in));
			StringBuilder sb = new StringBuilder();

			int[][] house = new int[12][10];

			for (int[] rooms : house) {
				for (int room : rooms) {
					room = 0;
				}
			}

			int n = Integer.parseInt(br.readLine());
			String[] strs;

			for (int i = 0; i < n; i++) {
				strs = br.readLine().split("\\s");
				house[(Integer.parseInt(strs[0]) - 1) * 3
						+ Integer.parseInt(strs[1]) - 1][Integer
						.parseInt(strs[2]) - 1] += Integer.parseInt(strs[3]);
			}

			for (int i = 0; i < house.length; i++) {
				for (int j = 0; j < house[i].length; j++) {
					if (j != 0 || j != house[i].length - 1)
						sb.append(" " + house[i][j]);
				}
				sb.append(BR);
				if (i != 0 && i != house.length - 1 && (i + 1) % 3 == 0)
					sb.append("####################" + BR);
			}
			System.out.print(sb);
			br.close();
		} catch (Exception e) {
			System.err.println(e);
		}
	}
}