import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
	Scanner in = new Scanner(System.in);
	StringBuilder sb = new StringBuilder();
	int[][][] inf = new int[4][3][10];
	int n = in.nextInt();
	for (int i = 0; i < n; i++) {
	    int b = in.nextInt();
	    int f = in.nextInt();
	    int r = in.nextInt();
	    int v = in.nextInt();
	    inf[b - 1][f - 1][r - 1] += v;
	}
	for (int build = 0; build < 4; build++) {
	    for (int floor = 0; floor < 3; floor++) {
		sb.setLength(0);
		for (int room = 0; room < 10; room++) {
		    sb.append(" ");
		    sb.append(inf[build][floor][room]);
		}
		System.out.println(sb);
	    }
	    if (build != 3) {
		System.out.println("####################");
	    }
	}
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
	Scanner in = new Scanner(System.in);
	StringBuilder sb = new StringBuilder();
	int[][][] inf = new int[4][3][10];
	int n = in.nextInt();
	for (int i = 0; i < n; i++) {
	    int b = in.nextInt();
	    int f = in.nextInt();
	    int r = in.nextInt();
	    int v = in.nextInt();
	    inf[b - 1][f - 1][r - 1] += v;
	}
	for (int build = 0; build < 4; build++) {
	    for (int floor = 0; floor < 3; floor++) {
		sb.setLength(0);
		for (int room = 0; room < 10; room++) {
		    sb.append(" ");
		    sb.append(inf[build][floor][room]);
		}
		System.out.println(sb);
	    }
	    if (build != 3) {
		System.out.println("####################");
	    }
	}
    }
} Main public static void main(String[] args) {
	Scanner in = new Scanner(System.in);
	StringBuilder sb = new StringBuilder();
	int[][][] inf = new int[4][3][10];
	int n = in.nextInt();
	for (int i = 0; i < n; i++) {
	    int b = in.nextInt();
	    int f = in.nextInt();
	    int r = in.nextInt();
	    int v = in.nextInt();
	    inf[b - 1][f - 1][r - 1] += v;
	}
	for (int build = 0; build < 4; build++) {
	    for (int floor = 0; floor < 3; floor++) {
		sb.setLength(0);
		for (int room = 0; room < 10; room++) {
		    sb.append(" ");
		    sb.append(inf[build][floor][room]);
		}
		System.out.println(sb);
	    }
	    if (build != 3) {
		System.out.println("####################");
	    }
	}
    } main {
	Scanner in = new Scanner(System.in);
	StringBuilder sb = new StringBuilder();
	int[][][] inf = new int[4][3][10];
	int n = in.nextInt();
	for (int i = 0; i < n; i++) {
	    int b = in.nextInt();
	    int f = in.nextInt();
	    int r = in.nextInt();
	    int v = in.nextInt();
	    inf[b - 1][f - 1][r - 1] += v;
	}
	for (int build = 0; build < 4; build++) {
	    for (int floor = 0; floor < 3; floor++) {
		sb.setLength(0);
		for (int room = 0; room < 10; room++) {
		    sb.append(" ");
		    sb.append(inf[build][floor][room]);
		}
		System.out.println(sb);
	    }
	    if (build != 3) {
		System.out.println("####################");
	    }
	}
    } Scanner in = new Scanner(System.in); in new Scanner(System.in) StringBuilder sb = new StringBuilder(); sb new StringBuilder() int[][][] inf = new int[4][3][10]; inf new int[4][3][10] 4 3 10 int n = in.nextInt(); n in.nextInt() in.nextInt in for (int i = 0; i < n; i++) {
	    int b = in.nextInt();
	    int f = in.nextInt();
	    int r = in.nextInt();
	    int v = in.nextInt();
	    inf[b - 1][f - 1][r - 1] += v;
	} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
	    int b = in.nextInt();
	    int f = in.nextInt();
	    int r = in.nextInt();
	    int v = in.nextInt();
	    inf[b - 1][f - 1][r - 1] += v;
	} {
	    int b = in.nextInt();
	    int f = in.nextInt();
	    int r = in.nextInt();
	    int v = in.nextInt();
	    inf[b - 1][f - 1][r - 1] += v;
	} int b = in.nextInt(); b in.nextInt() in.nextInt in int f = in.nextInt(); f in.nextInt() in.nextInt in int r = in.nextInt(); r in.nextInt() in.nextInt in int v = in.nextInt(); v in.nextInt() in.nextInt in inf[b - 1][f - 1][r - 1] += v inf[b - 1][f - 1][r - 1] inf[b - 1][f - 1] inf[b - 1] inf b - 1 b 1 f - 1 f 1 r - 1 r 1 v for (int build = 0; build < 4; build++) {
	    for (int floor = 0; floor < 3; floor++) {
		sb.setLength(0);
		for (int room = 0; room < 10; room++) {
		    sb.append(" ");
		    sb.append(inf[build][floor][room]);
		}
		System.out.println(sb);
	    }
	    if (build != 3) {
		System.out.println("####################");
	    }
	} int build = 0; int build = 0; build 0 build < 4 build 4 build++ build++ build {
	    for (int floor = 0; floor < 3; floor++) {
		sb.setLength(0);
		for (int room = 0; room < 10; room++) {
		    sb.append(" ");
		    sb.append(inf[build][floor][room]);
		}
		System.out.println(sb);
	    }
	    if (build != 3) {
		System.out.println("####################");
	    }
	} {
	    for (int floor = 0; floor < 3; floor++) {
		sb.setLength(0);
		for (int room = 0; room < 10; room++) {
		    sb.append(" ");
		    sb.append(inf[build][floor][room]);
		}
		System.out.println(sb);
	    }
	    if (build != 3) {
		System.out.println("####################");
	    }
	} for (int floor = 0; floor < 3; floor++) {
		sb.setLength(0);
		for (int room = 0; room < 10; room++) {
		    sb.append(" ");
		    sb.append(inf[build][floor][room]);
		}
		System.out.println(sb);
	    } int floor = 0; int floor = 0; floor 0 floor < 3 floor 3 floor++ floor++ floor {
		sb.setLength(0);
		for (int room = 0; room < 10; room++) {
		    sb.append(" ");
		    sb.append(inf[build][floor][room]);
		}
		System.out.println(sb);
	    } {
		sb.setLength(0);
		for (int room = 0; room < 10; room++) {
		    sb.append(" ");
		    sb.append(inf[build][floor][room]);
		}
		System.out.println(sb);
	    } sb.setLength(0) sb.setLength sb 0 for (int room = 0; room < 10; room++) {
		    sb.append(" ");
		    sb.append(inf[build][floor][room]);
		} int room = 0; int room = 0; room 0 room < 10 room 10 room++ room++ room {
		    sb.append(" ");
		    sb.append(inf[build][floor][room]);
		} {
		    sb.append(" ");
		    sb.append(inf[build][floor][room]);
		} sb.append(" ") sb.append sb " " sb.append(inf[build][floor][room]) sb.append sb inf[build][floor][room] inf[build][floor] inf[build] inf build floor room System.out.println(sb) System.out.println System.out System System.out sb if (build != 3) {
		System.out.println("####################");
	    } build != 3 build 3 {
		System.out.println("####################");
	    } System.out.println("####################") System.out.println System.out System System.out "####################" String[] args args public class Main {
    public static void main(String[] args) {
	Scanner in = new Scanner(System.in);
	StringBuilder sb = new StringBuilder();
	int[][][] inf = new int[4][3][10];
	int n = in.nextInt();
	for (int i = 0; i < n; i++) {
	    int b = in.nextInt();
	    int f = in.nextInt();
	    int r = in.nextInt();
	    int v = in.nextInt();
	    inf[b - 1][f - 1][r - 1] += v;
	}
	for (int build = 0; build < 4; build++) {
	    for (int floor = 0; floor < 3; floor++) {
		sb.setLength(0);
		for (int room = 0; room < 10; room++) {
		    sb.append(" ");
		    sb.append(inf[build][floor][room]);
		}
		System.out.println(sb);
	    }
	    if (build != 3) {
		System.out.println("####################");
	    }
	}
    }
} public class Main {
    public static void main(String[] args) {
	Scanner in = new Scanner(System.in);
	StringBuilder sb = new StringBuilder();
	int[][][] inf = new int[4][3][10];
	int n = in.nextInt();
	for (int i = 0; i < n; i++) {
	    int b = in.nextInt();
	    int f = in.nextInt();
	    int r = in.nextInt();
	    int v = in.nextInt();
	    inf[b - 1][f - 1][r - 1] += v;
	}
	for (int build = 0; build < 4; build++) {
	    for (int floor = 0; floor < 3; floor++) {
		sb.setLength(0);
		for (int room = 0; room < 10; room++) {
		    sb.append(" ");
		    sb.append(inf[build][floor][room]);
		}
		System.out.println(sb);
	    }
	    if (build != 3) {
		System.out.println("####################");
	    }
	}
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
	Scanner in = new Scanner(System.in);
	StringBuilder sb = new StringBuilder();
	int[][][] inf = new int[4][3][10];
	int n = in.nextInt();
	for (int i = 0; i < n; i++) {
	    int b = in.nextInt();
	    int f = in.nextInt();
	    int r = in.nextInt();
	    int v = in.nextInt();
	    inf[b - 1][f - 1][r - 1] += v;
	}
	for (int build = 0; build < 4; build++) {
	    for (int floor = 0; floor < 3; floor++) {
		sb.setLength(0);
		for (int room = 0; room < 10; room++) {
		    sb.append(" ");
		    sb.append(inf[build][floor][room]);
		}
		System.out.println(sb);
	    }
	    if (build != 3) {
		System.out.println("####################");
	    }
	}
    }
}
