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

public class Main {
	public static final String EOL = System.getProperty("line.separator");
	public static final String BUILD_SEPARATOR = "####################";
    public void exec() throws IOException {
    	try(BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    	PrintWriter out = new PrintWriter(System.out);){
            int n = Integer.parseInt(br.readLine());
            int[][][] bfr = new int[4][3][10];
            for(int i=0; i<n; i++) {
            	String[] str = br.readLine().split(" ");
            	int b = Integer.parseInt(str[0]);
            	int f = Integer.parseInt(str[1]);
            	int r = Integer.parseInt(str[2]);
            	int v = Integer.parseInt(str[3]);
            	bfr[b-1][f-1][r-1] += v;
            }
            
            StringBuilder sb = new StringBuilder();
            for(int b=0; b<4; b++) {
            	if(b>0) {
                	sb.append(BUILD_SEPARATOR).append(EOL);
            	}
            	for(int f=0; f<3; f++) {
                	for(int r=0; r<10; r++) {
                		sb.append(' ').append(bfr[b][f][r]);
                	}
                	sb.append(EOL);
            	}
            }
            out.print(sb.toString());
            out.flush();
    	}
    }
 
    public static void main(String[] args) throws IOException {
    	new Main().exec();
    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io import java.io.PrintWriter; PrintWriter java.io public class Main {
	public static final String EOL = System.getProperty("line.separator");
	public static final String BUILD_SEPARATOR = "####################";
    public void exec() throws IOException {
    	try(BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    	PrintWriter out = new PrintWriter(System.out);){
            int n = Integer.parseInt(br.readLine());
            int[][][] bfr = new int[4][3][10];
            for(int i=0; i<n; i++) {
            	String[] str = br.readLine().split(" ");
            	int b = Integer.parseInt(str[0]);
            	int f = Integer.parseInt(str[1]);
            	int r = Integer.parseInt(str[2]);
            	int v = Integer.parseInt(str[3]);
            	bfr[b-1][f-1][r-1] += v;
            }
            
            StringBuilder sb = new StringBuilder();
            for(int b=0; b<4; b++) {
            	if(b>0) {
                	sb.append(BUILD_SEPARATOR).append(EOL);
            	}
            	for(int f=0; f<3; f++) {
                	for(int r=0; r<10; r++) {
                		sb.append(' ').append(bfr[b][f][r]);
                	}
                	sb.append(EOL);
            	}
            }
            out.print(sb.toString());
            out.flush();
    	}
    }
 
    public static void main(String[] args) throws IOException {
    	new Main().exec();
    }
} Main public static final String EOL = System.getProperty("line.separator"); EOL System.getProperty("line.separator") System.getProperty System "line.separator" public static final String BUILD_SEPARATOR = "####################"; BUILD_SEPARATOR "####################" public void exec() throws IOException {
    	try(BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    	PrintWriter out = new PrintWriter(System.out);){
            int n = Integer.parseInt(br.readLine());
            int[][][] bfr = new int[4][3][10];
            for(int i=0; i<n; i++) {
            	String[] str = br.readLine().split(" ");
            	int b = Integer.parseInt(str[0]);
            	int f = Integer.parseInt(str[1]);
            	int r = Integer.parseInt(str[2]);
            	int v = Integer.parseInt(str[3]);
            	bfr[b-1][f-1][r-1] += v;
            }
            
            StringBuilder sb = new StringBuilder();
            for(int b=0; b<4; b++) {
            	if(b>0) {
                	sb.append(BUILD_SEPARATOR).append(EOL);
            	}
            	for(int f=0; f<3; f++) {
                	for(int r=0; r<10; r++) {
                		sb.append(' ').append(bfr[b][f][r]);
                	}
                	sb.append(EOL);
            	}
            }
            out.print(sb.toString());
            out.flush();
    	}
    } exec {
    	try(BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    	PrintWriter out = new PrintWriter(System.out);){
            int n = Integer.parseInt(br.readLine());
            int[][][] bfr = new int[4][3][10];
            for(int i=0; i<n; i++) {
            	String[] str = br.readLine().split(" ");
            	int b = Integer.parseInt(str[0]);
            	int f = Integer.parseInt(str[1]);
            	int r = Integer.parseInt(str[2]);
            	int v = Integer.parseInt(str[3]);
            	bfr[b-1][f-1][r-1] += v;
            }
            
            StringBuilder sb = new StringBuilder();
            for(int b=0; b<4; b++) {
            	if(b>0) {
                	sb.append(BUILD_SEPARATOR).append(EOL);
            	}
            	for(int f=0; f<3; f++) {
                	for(int r=0; r<10; r++) {
                		sb.append(' ').append(bfr[b][f][r]);
                	}
                	sb.append(EOL);
            	}
            }
            out.print(sb.toString());
            out.flush();
    	}
    } try(BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    	PrintWriter out = new PrintWriter(System.out);){
            int n = Integer.parseInt(br.readLine());
            int[][][] bfr = new int[4][3][10];
            for(int i=0; i<n; i++) {
            	String[] str = br.readLine().split(" ");
            	int b = Integer.parseInt(str[0]);
            	int f = Integer.parseInt(str[1]);
            	int r = Integer.parseInt(str[2]);
            	int v = Integer.parseInt(str[3]);
            	bfr[b-1][f-1][r-1] += v;
            }
            
            StringBuilder sb = new StringBuilder();
            for(int b=0; b<4; b++) {
            	if(b>0) {
                	sb.append(BUILD_SEPARATOR).append(EOL);
            	}
            	for(int f=0; f<3; f++) {
                	for(int r=0; r<10; r++) {
                		sb.append(' ').append(bfr[b][f][r]);
                	}
                	sb.append(EOL);
            	}
            }
            out.print(sb.toString());
            out.flush();
    	} {
            int n = Integer.parseInt(br.readLine());
            int[][][] bfr = new int[4][3][10];
            for(int i=0; i<n; i++) {
            	String[] str = br.readLine().split(" ");
            	int b = Integer.parseInt(str[0]);
            	int f = Integer.parseInt(str[1]);
            	int r = Integer.parseInt(str[2]);
            	int v = Integer.parseInt(str[3]);
            	bfr[b-1][f-1][r-1] += v;
            }
            
            StringBuilder sb = new StringBuilder();
            for(int b=0; b<4; b++) {
            	if(b>0) {
                	sb.append(BUILD_SEPARATOR).append(EOL);
            	}
            	for(int f=0; f<3; f++) {
                	for(int r=0; r<10; r++) {
                		sb.append(' ').append(bfr[b][f][r]);
                	}
                	sb.append(EOL);
            	}
            }
            out.print(sb.toString());
            out.flush();
    	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)) BufferedReader br = new BufferedReader(new InputStreamReader(System.in)) new BufferedReader(new InputStreamReader(System.in)) PrintWriter out = new PrintWriter(System.out) PrintWriter out = new PrintWriter(System.out) new PrintWriter(System.out) int n = Integer.parseInt(br.readLine()); n Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br int[][][] bfr = new int[4][3][10]; bfr new int[4][3][10] 4 3 10 for(int i=0; i<n; i++) {
            	String[] str = br.readLine().split(" ");
            	int b = Integer.parseInt(str[0]);
            	int f = Integer.parseInt(str[1]);
            	int r = Integer.parseInt(str[2]);
            	int v = Integer.parseInt(str[3]);
            	bfr[b-1][f-1][r-1] += v;
            } int i=0; int i=0; i 0 i<n i n i++ i++ i {
            	String[] str = br.readLine().split(" ");
            	int b = Integer.parseInt(str[0]);
            	int f = Integer.parseInt(str[1]);
            	int r = Integer.parseInt(str[2]);
            	int v = Integer.parseInt(str[3]);
            	bfr[b-1][f-1][r-1] += v;
            } {
            	String[] str = br.readLine().split(" ");
            	int b = Integer.parseInt(str[0]);
            	int f = Integer.parseInt(str[1]);
            	int r = Integer.parseInt(str[2]);
            	int v = Integer.parseInt(str[3]);
            	bfr[b-1][f-1][r-1] += v;
            } String[] str = br.readLine().split(" "); str br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " int b = Integer.parseInt(str[0]); b Integer.parseInt(str[0]) Integer.parseInt Integer str[0] str 0 int f = Integer.parseInt(str[1]); f Integer.parseInt(str[1]) Integer.parseInt Integer str[1] str 1 int r = Integer.parseInt(str[2]); r Integer.parseInt(str[2]) Integer.parseInt Integer str[2] str 2 int v = Integer.parseInt(str[3]); v Integer.parseInt(str[3]) Integer.parseInt Integer str[3] str 3 bfr[b-1][f-1][r-1] += v bfr[b-1][f-1][r-1] bfr[b-1][f-1] bfr[b-1] bfr b-1 b 1 f-1 f 1 r-1 r 1 v StringBuilder sb = new StringBuilder(); sb new StringBuilder() for(int b=0; b<4; b++) {
            	if(b>0) {
                	sb.append(BUILD_SEPARATOR).append(EOL);
            	}
            	for(int f=0; f<3; f++) {
                	for(int r=0; r<10; r++) {
                		sb.append(' ').append(bfr[b][f][r]);
                	}
                	sb.append(EOL);
            	}
            } int b=0; int b=0; b 0 b<4 b 4 b++ b++ b {
            	if(b>0) {
                	sb.append(BUILD_SEPARATOR).append(EOL);
            	}
            	for(int f=0; f<3; f++) {
                	for(int r=0; r<10; r++) {
                		sb.append(' ').append(bfr[b][f][r]);
                	}
                	sb.append(EOL);
            	}
            } {
            	if(b>0) {
                	sb.append(BUILD_SEPARATOR).append(EOL);
            	}
            	for(int f=0; f<3; f++) {
                	for(int r=0; r<10; r++) {
                		sb.append(' ').append(bfr[b][f][r]);
                	}
                	sb.append(EOL);
            	}
            } if(b>0) {
                	sb.append(BUILD_SEPARATOR).append(EOL);
            	} b>0 b 0 {
                	sb.append(BUILD_SEPARATOR).append(EOL);
            	} sb.append(BUILD_SEPARATOR).append(EOL) sb.append(BUILD_SEPARATOR).append sb.append(BUILD_SEPARATOR) sb.append sb BUILD_SEPARATOR EOL for(int f=0; f<3; f++) {
                	for(int r=0; r<10; r++) {
                		sb.append(' ').append(bfr[b][f][r]);
                	}
                	sb.append(EOL);
            	} int f=0; int f=0; f 0 f<3 f 3 f++ f++ f {
                	for(int r=0; r<10; r++) {
                		sb.append(' ').append(bfr[b][f][r]);
                	}
                	sb.append(EOL);
            	} {
                	for(int r=0; r<10; r++) {
                		sb.append(' ').append(bfr[b][f][r]);
                	}
                	sb.append(EOL);
            	} for(int r=0; r<10; r++) {
                		sb.append(' ').append(bfr[b][f][r]);
                	} int r=0; int r=0; r 0 r<10 r 10 r++ r++ r {
                		sb.append(' ').append(bfr[b][f][r]);
                	} {
                		sb.append(' ').append(bfr[b][f][r]);
                	} sb.append(' ').append(bfr[b][f][r]) sb.append(' ').append sb.append(' ') sb.append sb ' ' bfr[b][f][r] bfr[b][f] bfr[b] bfr b f r sb.append(EOL) sb.append sb EOL out.print(sb.toString()) out.print out sb.toString() sb.toString sb out.flush() out.flush out public static void main(String[] args) throws IOException {
    	new Main().exec();
    } main {
    	new Main().exec();
    } new Main().exec() new Main().exec new Main() String[] args args public class Main {
	public static final String EOL = System.getProperty("line.separator");
	public static final String BUILD_SEPARATOR = "####################";
    public void exec() throws IOException {
    	try(BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    	PrintWriter out = new PrintWriter(System.out);){
            int n = Integer.parseInt(br.readLine());
            int[][][] bfr = new int[4][3][10];
            for(int i=0; i<n; i++) {
            	String[] str = br.readLine().split(" ");
            	int b = Integer.parseInt(str[0]);
            	int f = Integer.parseInt(str[1]);
            	int r = Integer.parseInt(str[2]);
            	int v = Integer.parseInt(str[3]);
            	bfr[b-1][f-1][r-1] += v;
            }
            
            StringBuilder sb = new StringBuilder();
            for(int b=0; b<4; b++) {
            	if(b>0) {
                	sb.append(BUILD_SEPARATOR).append(EOL);
            	}
            	for(int f=0; f<3; f++) {
                	for(int r=0; r<10; r++) {
                		sb.append(' ').append(bfr[b][f][r]);
                	}
                	sb.append(EOL);
            	}
            }
            out.print(sb.toString());
            out.flush();
    	}
    }
 
    public static void main(String[] args) throws IOException {
    	new Main().exec();
    }
} public class Main {
	public static final String EOL = System.getProperty("line.separator");
	public static final String BUILD_SEPARATOR = "####################";
    public void exec() throws IOException {
    	try(BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    	PrintWriter out = new PrintWriter(System.out);){
            int n = Integer.parseInt(br.readLine());
            int[][][] bfr = new int[4][3][10];
            for(int i=0; i<n; i++) {
            	String[] str = br.readLine().split(" ");
            	int b = Integer.parseInt(str[0]);
            	int f = Integer.parseInt(str[1]);
            	int r = Integer.parseInt(str[2]);
            	int v = Integer.parseInt(str[3]);
            	bfr[b-1][f-1][r-1] += v;
            }
            
            StringBuilder sb = new StringBuilder();
            for(int b=0; b<4; b++) {
            	if(b>0) {
                	sb.append(BUILD_SEPARATOR).append(EOL);
            	}
            	for(int f=0; f<3; f++) {
                	for(int r=0; r<10; r++) {
                		sb.append(' ').append(bfr[b][f][r]);
                	}
                	sb.append(EOL);
            	}
            }
            out.print(sb.toString());
            out.flush();
    	}
    }
 
    public static void main(String[] args) throws IOException {
    	new Main().exec();
    }
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;

public class Main {
	public static final String EOL = System.getProperty("line.separator");
	public static final String BUILD_SEPARATOR = "####################";
    public void exec() throws IOException {
    	try(BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    	PrintWriter out = new PrintWriter(System.out);){
            int n = Integer.parseInt(br.readLine());
            int[][][] bfr = new int[4][3][10];
            for(int i=0; i<n; i++) {
            	String[] str = br.readLine().split(" ");
            	int b = Integer.parseInt(str[0]);
            	int f = Integer.parseInt(str[1]);
            	int r = Integer.parseInt(str[2]);
            	int v = Integer.parseInt(str[3]);
            	bfr[b-1][f-1][r-1] += v;
            }
            
            StringBuilder sb = new StringBuilder();
            for(int b=0; b<4; b++) {
            	if(b>0) {
                	sb.append(BUILD_SEPARATOR).append(EOL);
            	}
            	for(int f=0; f<3; f++) {
                	for(int r=0; r<10; r++) {
                		sb.append(' ').append(bfr[b][f][r]);
                	}
                	sb.append(EOL);
            	}
            }
            out.print(sb.toString());
            out.flush();
    	}
    }
 
    public static void main(String[] args) throws IOException {
    	new Main().exec();
    }
}