import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int[][][] l = new int[4][3][10];

        for(int i = 0; i < a; i++) {
        	int tou = sc.nextInt();
        	int kai = sc.nextInt();
        	int heya = sc.nextInt();
        	int ninzu = sc.nextInt();

        	l[tou-1][kai-1][heya-1] += ninzu;
        }

        for(int i = 0; i < 4; i++) {
        	for(int j = 0; j < 3; j++) {
        		for(int k = 0; k < 10; k++) {
        			System.out.print(" " + l[i][j][k]);
        		}
        		System.out.println();
        	}

        	if(i != 3) System.out.println("####################");
        }
	}
}
 import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int[][][] l = new int[4][3][10];

        for(int i = 0; i < a; i++) {
        	int tou = sc.nextInt();
        	int kai = sc.nextInt();
        	int heya = sc.nextInt();
        	int ninzu = sc.nextInt();

        	l[tou-1][kai-1][heya-1] += ninzu;
        }

        for(int i = 0; i < 4; i++) {
        	for(int j = 0; j < 3; j++) {
        		for(int k = 0; k < 10; k++) {
        			System.out.print(" " + l[i][j][k]);
        		}
        		System.out.println();
        	}

        	if(i != 3) System.out.println("####################");
        }
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int[][][] l = new int[4][3][10];

        for(int i = 0; i < a; i++) {
        	int tou = sc.nextInt();
        	int kai = sc.nextInt();
        	int heya = sc.nextInt();
        	int ninzu = sc.nextInt();

        	l[tou-1][kai-1][heya-1] += ninzu;
        }

        for(int i = 0; i < 4; i++) {
        	for(int j = 0; j < 3; j++) {
        		for(int k = 0; k < 10; k++) {
        			System.out.print(" " + l[i][j][k]);
        		}
        		System.out.println();
        	}

        	if(i != 3) System.out.println("####################");
        }
	} main {
		Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int[][][] l = new int[4][3][10];

        for(int i = 0; i < a; i++) {
        	int tou = sc.nextInt();
        	int kai = sc.nextInt();
        	int heya = sc.nextInt();
        	int ninzu = sc.nextInt();

        	l[tou-1][kai-1][heya-1] += ninzu;
        }

        for(int i = 0; i < 4; i++) {
        	for(int j = 0; j < 3; j++) {
        		for(int k = 0; k < 10; k++) {
        			System.out.print(" " + l[i][j][k]);
        		}
        		System.out.println();
        	}

        	if(i != 3) System.out.println("####################");
        }
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int a = sc.nextInt(); a sc.nextInt() sc.nextInt sc int[][][] l = new int[4][3][10]; l new int[4][3][10] 4 3 10 for(int i = 0; i < a; i++) {
        	int tou = sc.nextInt();
        	int kai = sc.nextInt();
        	int heya = sc.nextInt();
        	int ninzu = sc.nextInt();

        	l[tou-1][kai-1][heya-1] += ninzu;
        } int i = 0; int i = 0; i 0 i < a i a i++ i++ i {
        	int tou = sc.nextInt();
        	int kai = sc.nextInt();
        	int heya = sc.nextInt();
        	int ninzu = sc.nextInt();

        	l[tou-1][kai-1][heya-1] += ninzu;
        } {
        	int tou = sc.nextInt();
        	int kai = sc.nextInt();
        	int heya = sc.nextInt();
        	int ninzu = sc.nextInt();

        	l[tou-1][kai-1][heya-1] += ninzu;
        } int tou = sc.nextInt(); tou sc.nextInt() sc.nextInt sc int kai = sc.nextInt(); kai sc.nextInt() sc.nextInt sc int heya = sc.nextInt(); heya sc.nextInt() sc.nextInt sc int ninzu = sc.nextInt(); ninzu sc.nextInt() sc.nextInt sc l[tou-1][kai-1][heya-1] += ninzu l[tou-1][kai-1][heya-1] l[tou-1][kai-1] l[tou-1] l tou-1 tou 1 kai-1 kai 1 heya-1 heya 1 ninzu for(int i = 0; i < 4; i++) {
        	for(int j = 0; j < 3; j++) {
        		for(int k = 0; k < 10; k++) {
        			System.out.print(" " + l[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(" " + l[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(" " + l[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(" " + l[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(" " + l[i][j][k]);
        		}
        		System.out.println();
        	} {
        		for(int k = 0; k < 10; k++) {
        			System.out.print(" " + l[i][j][k]);
        		}
        		System.out.println();
        	} for(int k = 0; k < 10; k++) {
        			System.out.print(" " + l[i][j][k]);
        		} int k = 0; int k = 0; k 0 k < 10 k 10 k++ k++ k {
        			System.out.print(" " + l[i][j][k]);
        		} {
        			System.out.print(" " + l[i][j][k]);
        		} System.out.print(" " + l[i][j][k]) System.out.print System.out System System.out " " + l[i][j][k] " " l[i][j][k] l[i][j] l[i] l 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 System System.out "####################" String[] args args public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int[][][] l = new int[4][3][10];

        for(int i = 0; i < a; i++) {
        	int tou = sc.nextInt();
        	int kai = sc.nextInt();
        	int heya = sc.nextInt();
        	int ninzu = sc.nextInt();

        	l[tou-1][kai-1][heya-1] += ninzu;
        }

        for(int i = 0; i < 4; i++) {
        	for(int j = 0; j < 3; j++) {
        		for(int k = 0; k < 10; k++) {
        			System.out.print(" " + l[i][j][k]);
        		}
        		System.out.println();
        	}

        	if(i != 3) System.out.println("####################");
        }
	}
} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int[][][] l = new int[4][3][10];

        for(int i = 0; i < a; i++) {
        	int tou = sc.nextInt();
        	int kai = sc.nextInt();
        	int heya = sc.nextInt();
        	int ninzu = sc.nextInt();

        	l[tou-1][kai-1][heya-1] += ninzu;
        }

        for(int i = 0; i < 4; i++) {
        	for(int j = 0; j < 3; j++) {
        		for(int k = 0; k < 10; k++) {
        			System.out.print(" " + l[i][j][k]);
        		}
        		System.out.println();
        	}

        	if(i != 3) System.out.println("####################");
        }
	}
} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int[][][] l = new int[4][3][10];

        for(int i = 0; i < a; i++) {
        	int tou = sc.nextInt();
        	int kai = sc.nextInt();
        	int heya = sc.nextInt();
        	int ninzu = sc.nextInt();

        	l[tou-1][kai-1][heya-1] += ninzu;
        }

        for(int i = 0; i < 4; i++) {
        	for(int j = 0; j < 3; j++) {
        		for(int k = 0; k < 10; k++) {
        			System.out.print(" " + l[i][j][k]);
        		}
        		System.out.println();
        	}

        	if(i != 3) System.out.println("####################");
        }
	}
}

