import java.util.Scanner;
public class Main{
    public static void main(String[] args) {
	Scanner scan = new Scanner(System.in);
	int[][][] houses = new int[4][3][10];	
	int n = scan.nextInt();
	for (int cnt = 0; cnt < n; cnt++) {
	    int b = scan.nextInt() - 1;
	    int f = scan.nextInt() - 1;
	    int r = scan.nextInt() - 1;
	    int v = scan.nextInt();
	    houses[b][f][r] += v;
	}
	for (int b = 0; b < 4; b++) {
	    for (int f = 0; f < 3; f++) {
		for (int r = 0; r < 10; r++) {
		    System.out.print(" " + houses[b][f][r]);
		}
		System.out.println();
	    }
	    if (b != 3) {
		for (int i = 0; i < 20; i++) {
		    System.out.print("#");
		}
		System.out.println();
	    }
	}
    }
} import java.util.Scanner; Scanner java.util public class Main{
    public static void main(String[] args) {
	Scanner scan = new Scanner(System.in);
	int[][][] houses = new int[4][3][10];	
	int n = scan.nextInt();
	for (int cnt = 0; cnt < n; cnt++) {
	    int b = scan.nextInt() - 1;
	    int f = scan.nextInt() - 1;
	    int r = scan.nextInt() - 1;
	    int v = scan.nextInt();
	    houses[b][f][r] += v;
	}
	for (int b = 0; b < 4; b++) {
	    for (int f = 0; f < 3; f++) {
		for (int r = 0; r < 10; r++) {
		    System.out.print(" " + houses[b][f][r]);
		}
		System.out.println();
	    }
	    if (b != 3) {
		for (int i = 0; i < 20; i++) {
		    System.out.print("#");
		}
		System.out.println();
	    }
	}
    }
} Main public static void main(String[] args) {
	Scanner scan = new Scanner(System.in);
	int[][][] houses = new int[4][3][10];	
	int n = scan.nextInt();
	for (int cnt = 0; cnt < n; cnt++) {
	    int b = scan.nextInt() - 1;
	    int f = scan.nextInt() - 1;
	    int r = scan.nextInt() - 1;
	    int v = scan.nextInt();
	    houses[b][f][r] += v;
	}
	for (int b = 0; b < 4; b++) {
	    for (int f = 0; f < 3; f++) {
		for (int r = 0; r < 10; r++) {
		    System.out.print(" " + houses[b][f][r]);
		}
		System.out.println();
	    }
	    if (b != 3) {
		for (int i = 0; i < 20; i++) {
		    System.out.print("#");
		}
		System.out.println();
	    }
	}
    } main {
	Scanner scan = new Scanner(System.in);
	int[][][] houses = new int[4][3][10];	
	int n = scan.nextInt();
	for (int cnt = 0; cnt < n; cnt++) {
	    int b = scan.nextInt() - 1;
	    int f = scan.nextInt() - 1;
	    int r = scan.nextInt() - 1;
	    int v = scan.nextInt();
	    houses[b][f][r] += v;
	}
	for (int b = 0; b < 4; b++) {
	    for (int f = 0; f < 3; f++) {
		for (int r = 0; r < 10; r++) {
		    System.out.print(" " + houses[b][f][r]);
		}
		System.out.println();
	    }
	    if (b != 3) {
		for (int i = 0; i < 20; i++) {
		    System.out.print("#");
		}
		System.out.println();
	    }
	}
    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int[][][] houses = new int[4][3][10]; houses new int[4][3][10] 4 3 10 int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan for (int cnt = 0; cnt < n; cnt++) {
	    int b = scan.nextInt() - 1;
	    int f = scan.nextInt() - 1;
	    int r = scan.nextInt() - 1;
	    int v = scan.nextInt();
	    houses[b][f][r] += v;
	} int cnt = 0; int cnt = 0; cnt 0 cnt < n cnt n cnt++ cnt++ cnt {
	    int b = scan.nextInt() - 1;
	    int f = scan.nextInt() - 1;
	    int r = scan.nextInt() - 1;
	    int v = scan.nextInt();
	    houses[b][f][r] += v;
	} {
	    int b = scan.nextInt() - 1;
	    int f = scan.nextInt() - 1;
	    int r = scan.nextInt() - 1;
	    int v = scan.nextInt();
	    houses[b][f][r] += v;
	} int b = scan.nextInt() - 1; b scan.nextInt() - 1 scan.nextInt() scan.nextInt scan 1 int f = scan.nextInt() - 1; f scan.nextInt() - 1 scan.nextInt() scan.nextInt scan 1 int r = scan.nextInt() - 1; r scan.nextInt() - 1 scan.nextInt() scan.nextInt scan 1 int v = scan.nextInt(); v scan.nextInt() scan.nextInt scan houses[b][f][r] += v houses[b][f][r] houses[b][f] houses[b] houses b f r v for (int b = 0; b < 4; b++) {
	    for (int f = 0; f < 3; f++) {
		for (int r = 0; r < 10; r++) {
		    System.out.print(" " + houses[b][f][r]);
		}
		System.out.println();
	    }
	    if (b != 3) {
		for (int i = 0; i < 20; i++) {
		    System.out.print("#");
		}
		System.out.println();
	    }
	} int b = 0; int b = 0; b 0 b < 4 b 4 b++ b++ b {
	    for (int f = 0; f < 3; f++) {
		for (int r = 0; r < 10; r++) {
		    System.out.print(" " + houses[b][f][r]);
		}
		System.out.println();
	    }
	    if (b != 3) {
		for (int i = 0; i < 20; i++) {
		    System.out.print("#");
		}
		System.out.println();
	    }
	} {
	    for (int f = 0; f < 3; f++) {
		for (int r = 0; r < 10; r++) {
		    System.out.print(" " + houses[b][f][r]);
		}
		System.out.println();
	    }
	    if (b != 3) {
		for (int i = 0; i < 20; i++) {
		    System.out.print("#");
		}
		System.out.println();
	    }
	} for (int f = 0; f < 3; f++) {
		for (int r = 0; r < 10; r++) {
		    System.out.print(" " + houses[b][f][r]);
		}
		System.out.println();
	    } int f = 0; int f = 0; f 0 f < 3 f 3 f++ f++ f {
		for (int r = 0; r < 10; r++) {
		    System.out.print(" " + houses[b][f][r]);
		}
		System.out.println();
	    } {
		for (int r = 0; r < 10; r++) {
		    System.out.print(" " + houses[b][f][r]);
		}
		System.out.println();
	    } for (int r = 0; r < 10; r++) {
		    System.out.print(" " + houses[b][f][r]);
		} int r = 0; int r = 0; r 0 r < 10 r 10 r++ r++ r {
		    System.out.print(" " + houses[b][f][r]);
		} {
		    System.out.print(" " + houses[b][f][r]);
		} System.out.print(" " + houses[b][f][r]) System.out.print System.out System System.out " " + houses[b][f][r] " " houses[b][f][r] houses[b][f] houses[b] houses b f r System.out.println() System.out.println System.out System System.out if (b != 3) {
		for (int i = 0; i < 20; i++) {
		    System.out.print("#");
		}
		System.out.println();
	    } b != 3 b 3 {
		for (int i = 0; i < 20; i++) {
		    System.out.print("#");
		}
		System.out.println();
	    } for (int i = 0; i < 20; i++) {
		    System.out.print("#");
		} int i = 0; int i = 0; i 0 i < 20 i 20 i++ i++ i {
		    System.out.print("#");
		} {
		    System.out.print("#");
		} System.out.print("#") System.out.print System.out System System.out "#" System.out.println() System.out.println System.out System System.out String[] args args public class Main{
    public static void main(String[] args) {
	Scanner scan = new Scanner(System.in);
	int[][][] houses = new int[4][3][10];	
	int n = scan.nextInt();
	for (int cnt = 0; cnt < n; cnt++) {
	    int b = scan.nextInt() - 1;
	    int f = scan.nextInt() - 1;
	    int r = scan.nextInt() - 1;
	    int v = scan.nextInt();
	    houses[b][f][r] += v;
	}
	for (int b = 0; b < 4; b++) {
	    for (int f = 0; f < 3; f++) {
		for (int r = 0; r < 10; r++) {
		    System.out.print(" " + houses[b][f][r]);
		}
		System.out.println();
	    }
	    if (b != 3) {
		for (int i = 0; i < 20; i++) {
		    System.out.print("#");
		}
		System.out.println();
	    }
	}
    }
} public class Main{
    public static void main(String[] args) {
	Scanner scan = new Scanner(System.in);
	int[][][] houses = new int[4][3][10];	
	int n = scan.nextInt();
	for (int cnt = 0; cnt < n; cnt++) {
	    int b = scan.nextInt() - 1;
	    int f = scan.nextInt() - 1;
	    int r = scan.nextInt() - 1;
	    int v = scan.nextInt();
	    houses[b][f][r] += v;
	}
	for (int b = 0; b < 4; b++) {
	    for (int f = 0; f < 3; f++) {
		for (int r = 0; r < 10; r++) {
		    System.out.print(" " + houses[b][f][r]);
		}
		System.out.println();
	    }
	    if (b != 3) {
		for (int i = 0; i < 20; i++) {
		    System.out.print("#");
		}
		System.out.println();
	    }
	}
    }
} Main
import java.util.Scanner;
public class Main{
    public static void main(String[] args) {
	Scanner scan = new Scanner(System.in);
	int[][][] houses = new int[4][3][10];	
	int n = scan.nextInt();
	for (int cnt = 0; cnt < n; cnt++) {
	    int b = scan.nextInt() - 1;
	    int f = scan.nextInt() - 1;
	    int r = scan.nextInt() - 1;
	    int v = scan.nextInt();
	    houses[b][f][r] += v;
	}
	for (int b = 0; b < 4; b++) {
	    for (int f = 0; f < 3; f++) {
		for (int r = 0; r < 10; r++) {
		    System.out.print(" " + houses[b][f][r]);
		}
		System.out.println();
	    }
	    if (b != 3) {
		for (int i = 0; i < 20; i++) {
		    System.out.print("#");
		}
		System.out.println();
	    }
	}
    }
}