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

public class Main {

	public static void main(String[] args) throws Exception {
        // TODO ?????????????????????????????????????????????
        
        boolean first=true;
        try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
            String line;
            int i=0,n=0;
            int[][] card=new int[12][10];
            while ((line = br.readLine()) != null) {
            	if(first){
            		n=Integer.parseInt(line);
            		first=false;
            	}else{
            		String[] str=line.split(" ");
            		int a=Integer.parseInt(str[0]);
            		int b=Integer.parseInt(str[1]);
            		int c=Integer.parseInt(str[2]);
            		int d=Integer.parseInt(str[3]);
            		card[(a-1)*3+b-1][c-1]+=d;
            		i++;
            		if(i==n){
            			for(int j=0;j<12;j++){
            				for(int l=0;l<10;l++){
            					System.out.print(" "+card[j][l]);
            				}
            				System.out.println("");
            				if((j+1)%3==0&&j!=11){
            					System.out.println("####################");
            				}
            			}
            			break;
            		}
                	
            	}
            }
        }
    }

} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {

	public static void main(String[] args) throws Exception {
        // TODO ?????????????????????????????????????????????
        
        boolean first=true;
        try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
            String line;
            int i=0,n=0;
            int[][] card=new int[12][10];
            while ((line = br.readLine()) != null) {
            	if(first){
            		n=Integer.parseInt(line);
            		first=false;
            	}else{
            		String[] str=line.split(" ");
            		int a=Integer.parseInt(str[0]);
            		int b=Integer.parseInt(str[1]);
            		int c=Integer.parseInt(str[2]);
            		int d=Integer.parseInt(str[3]);
            		card[(a-1)*3+b-1][c-1]+=d;
            		i++;
            		if(i==n){
            			for(int j=0;j<12;j++){
            				for(int l=0;l<10;l++){
            					System.out.print(" "+card[j][l]);
            				}
            				System.out.println("");
            				if((j+1)%3==0&&j!=11){
            					System.out.println("####################");
            				}
            			}
            			break;
            		}
                	
            	}
            }
        }
    }

} Main public static void main(String[] args) throws Exception {
        // TODO ?????????????????????????????????????????????
        
        boolean first=true;
        try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
            String line;
            int i=0,n=0;
            int[][] card=new int[12][10];
            while ((line = br.readLine()) != null) {
            	if(first){
            		n=Integer.parseInt(line);
            		first=false;
            	}else{
            		String[] str=line.split(" ");
            		int a=Integer.parseInt(str[0]);
            		int b=Integer.parseInt(str[1]);
            		int c=Integer.parseInt(str[2]);
            		int d=Integer.parseInt(str[3]);
            		card[(a-1)*3+b-1][c-1]+=d;
            		i++;
            		if(i==n){
            			for(int j=0;j<12;j++){
            				for(int l=0;l<10;l++){
            					System.out.print(" "+card[j][l]);
            				}
            				System.out.println("");
            				if((j+1)%3==0&&j!=11){
            					System.out.println("####################");
            				}
            			}
            			break;
            		}
                	
            	}
            }
        }
    } main {
        // TODO ?????????????????????????????????????????????
        
        boolean first=true;
        try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
            String line;
            int i=0,n=0;
            int[][] card=new int[12][10];
            while ((line = br.readLine()) != null) {
            	if(first){
            		n=Integer.parseInt(line);
            		first=false;
            	}else{
            		String[] str=line.split(" ");
            		int a=Integer.parseInt(str[0]);
            		int b=Integer.parseInt(str[1]);
            		int c=Integer.parseInt(str[2]);
            		int d=Integer.parseInt(str[3]);
            		card[(a-1)*3+b-1][c-1]+=d;
            		i++;
            		if(i==n){
            			for(int j=0;j<12;j++){
            				for(int l=0;l<10;l++){
            					System.out.print(" "+card[j][l]);
            				}
            				System.out.println("");
            				if((j+1)%3==0&&j!=11){
            					System.out.println("####################");
            				}
            			}
            			break;
            		}
                	
            	}
            }
        }
    } boolean first=true; first true try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
            String line;
            int i=0,n=0;
            int[][] card=new int[12][10];
            while ((line = br.readLine()) != null) {
            	if(first){
            		n=Integer.parseInt(line);
            		first=false;
            	}else{
            		String[] str=line.split(" ");
            		int a=Integer.parseInt(str[0]);
            		int b=Integer.parseInt(str[1]);
            		int c=Integer.parseInt(str[2]);
            		int d=Integer.parseInt(str[3]);
            		card[(a-1)*3+b-1][c-1]+=d;
            		i++;
            		if(i==n){
            			for(int j=0;j<12;j++){
            				for(int l=0;l<10;l++){
            					System.out.print(" "+card[j][l]);
            				}
            				System.out.println("");
            				if((j+1)%3==0&&j!=11){
            					System.out.println("####################");
            				}
            			}
            			break;
            		}
                	
            	}
            }
        } {
            String line;
            int i=0,n=0;
            int[][] card=new int[12][10];
            while ((line = br.readLine()) != null) {
            	if(first){
            		n=Integer.parseInt(line);
            		first=false;
            	}else{
            		String[] str=line.split(" ");
            		int a=Integer.parseInt(str[0]);
            		int b=Integer.parseInt(str[1]);
            		int c=Integer.parseInt(str[2]);
            		int d=Integer.parseInt(str[3]);
            		card[(a-1)*3+b-1][c-1]+=d;
            		i++;
            		if(i==n){
            			for(int j=0;j<12;j++){
            				for(int l=0;l<10;l++){
            					System.out.print(" "+card[j][l]);
            				}
            				System.out.println("");
            				if((j+1)%3==0&&j!=11){
            					System.out.println("####################");
            				}
            			}
            			break;
            		}
                	
            	}
            }
        } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)) BufferedReader br = new BufferedReader(new InputStreamReader(System.in)) new BufferedReader(new InputStreamReader(System.in)) String line; line int i=0 i 0 n=0; n 0 int[][] card=new int[12][10]; card new int[12][10] 12 10 while ((line = br.readLine()) != null) {
            	if(first){
            		n=Integer.parseInt(line);
            		first=false;
            	}else{
            		String[] str=line.split(" ");
            		int a=Integer.parseInt(str[0]);
            		int b=Integer.parseInt(str[1]);
            		int c=Integer.parseInt(str[2]);
            		int d=Integer.parseInt(str[3]);
            		card[(a-1)*3+b-1][c-1]+=d;
            		i++;
            		if(i==n){
            			for(int j=0;j<12;j++){
            				for(int l=0;l<10;l++){
            					System.out.print(" "+card[j][l]);
            				}
            				System.out.println("");
            				if((j+1)%3==0&&j!=11){
            					System.out.println("####################");
            				}
            			}
            			break;
            		}
                	
            	}
            } (line = br.readLine()) != null (line = br.readLine()) line br.readLine() br.readLine br null {
            	if(first){
            		n=Integer.parseInt(line);
            		first=false;
            	}else{
            		String[] str=line.split(" ");
            		int a=Integer.parseInt(str[0]);
            		int b=Integer.parseInt(str[1]);
            		int c=Integer.parseInt(str[2]);
            		int d=Integer.parseInt(str[3]);
            		card[(a-1)*3+b-1][c-1]+=d;
            		i++;
            		if(i==n){
            			for(int j=0;j<12;j++){
            				for(int l=0;l<10;l++){
            					System.out.print(" "+card[j][l]);
            				}
            				System.out.println("");
            				if((j+1)%3==0&&j!=11){
            					System.out.println("####################");
            				}
            			}
            			break;
            		}
                	
            	}
            } if(first){
            		n=Integer.parseInt(line);
            		first=false;
            	}else{
            		String[] str=line.split(" ");
            		int a=Integer.parseInt(str[0]);
            		int b=Integer.parseInt(str[1]);
            		int c=Integer.parseInt(str[2]);
            		int d=Integer.parseInt(str[3]);
            		card[(a-1)*3+b-1][c-1]+=d;
            		i++;
            		if(i==n){
            			for(int j=0;j<12;j++){
            				for(int l=0;l<10;l++){
            					System.out.print(" "+card[j][l]);
            				}
            				System.out.println("");
            				if((j+1)%3==0&&j!=11){
            					System.out.println("####################");
            				}
            			}
            			break;
            		}
                	
            	} first {
            		n=Integer.parseInt(line);
            		first=false;
            	} n=Integer.parseInt(line) n Integer.parseInt(line) Integer.parseInt Integer line first=false first false {
            		String[] str=line.split(" ");
            		int a=Integer.parseInt(str[0]);
            		int b=Integer.parseInt(str[1]);
            		int c=Integer.parseInt(str[2]);
            		int d=Integer.parseInt(str[3]);
            		card[(a-1)*3+b-1][c-1]+=d;
            		i++;
            		if(i==n){
            			for(int j=0;j<12;j++){
            				for(int l=0;l<10;l++){
            					System.out.print(" "+card[j][l]);
            				}
            				System.out.println("");
            				if((j+1)%3==0&&j!=11){
            					System.out.println("####################");
            				}
            			}
            			break;
            		}
                	
            	} String[] str=line.split(" "); str line.split(" ") line.split line " " int a=Integer.parseInt(str[0]); a Integer.parseInt(str[0]) Integer.parseInt Integer str[0] str 0 int b=Integer.parseInt(str[1]); b Integer.parseInt(str[1]) Integer.parseInt Integer str[1] str 1 int c=Integer.parseInt(str[2]); c Integer.parseInt(str[2]) Integer.parseInt Integer str[2] str 2 int d=Integer.parseInt(str[3]); d Integer.parseInt(str[3]) Integer.parseInt Integer str[3] str 3 card[(a-1)*3+b-1][c-1]+=d card[(a-1)*3+b-1][c-1] card[(a-1)*3+b-1] card (a-1)*3+b-1 (a-1)*3+b (a-1)*3 (a-1) a 1 3 b 1 c-1 c 1 d i++ i if(i==n){
            			for(int j=0;j<12;j++){
            				for(int l=0;l<10;l++){
            					System.out.print(" "+card[j][l]);
            				}
            				System.out.println("");
            				if((j+1)%3==0&&j!=11){
            					System.out.println("####################");
            				}
            			}
            			break;
            		} i==n i n {
            			for(int j=0;j<12;j++){
            				for(int l=0;l<10;l++){
            					System.out.print(" "+card[j][l]);
            				}
            				System.out.println("");
            				if((j+1)%3==0&&j!=11){
            					System.out.println("####################");
            				}
            			}
            			break;
            		} for(int j=0;j<12;j++){
            				for(int l=0;l<10;l++){
            					System.out.print(" "+card[j][l]);
            				}
            				System.out.println("");
            				if((j+1)%3==0&&j!=11){
            					System.out.println("####################");
            				}
            			} int j=0; int j=0; j 0 j<12 j 12 j++ j++ j {
            				for(int l=0;l<10;l++){
            					System.out.print(" "+card[j][l]);
            				}
            				System.out.println("");
            				if((j+1)%3==0&&j!=11){
            					System.out.println("####################");
            				}
            			} {
            				for(int l=0;l<10;l++){
            					System.out.print(" "+card[j][l]);
            				}
            				System.out.println("");
            				if((j+1)%3==0&&j!=11){
            					System.out.println("####################");
            				}
            			} for(int l=0;l<10;l++){
            					System.out.print(" "+card[j][l]);
            				} int l=0; int l=0; l 0 l<10 l 10 l++ l++ l {
            					System.out.print(" "+card[j][l]);
            				} {
            					System.out.print(" "+card[j][l]);
            				} System.out.print(" "+card[j][l]) System.out.print System.out System System.out " "+card[j][l] " " card[j][l] card[j] card j l System.out.println("") System.out.println System.out System System.out "" if((j+1)%3==0&&j!=11){
            					System.out.println("####################");
            				} (j+1)%3==0&&j!=11 (j+1)%3==0 (j+1)%3 (j+1) j 1 3 0 j!=11 j 11 {
            					System.out.println("####################");
            				} System.out.println("####################") System.out.println System.out System System.out "####################" break; String[] args args public class Main {

	public static void main(String[] args) throws Exception {
        // TODO ?????????????????????????????????????????????
        
        boolean first=true;
        try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
            String line;
            int i=0,n=0;
            int[][] card=new int[12][10];
            while ((line = br.readLine()) != null) {
            	if(first){
            		n=Integer.parseInt(line);
            		first=false;
            	}else{
            		String[] str=line.split(" ");
            		int a=Integer.parseInt(str[0]);
            		int b=Integer.parseInt(str[1]);
            		int c=Integer.parseInt(str[2]);
            		int d=Integer.parseInt(str[3]);
            		card[(a-1)*3+b-1][c-1]+=d;
            		i++;
            		if(i==n){
            			for(int j=0;j<12;j++){
            				for(int l=0;l<10;l++){
            					System.out.print(" "+card[j][l]);
            				}
            				System.out.println("");
            				if((j+1)%3==0&&j!=11){
            					System.out.println("####################");
            				}
            			}
            			break;
            		}
                	
            	}
            }
        }
    }

} public class Main {

	public static void main(String[] args) throws Exception {
        // TODO ?????????????????????????????????????????????
        
        boolean first=true;
        try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
            String line;
            int i=0,n=0;
            int[][] card=new int[12][10];
            while ((line = br.readLine()) != null) {
            	if(first){
            		n=Integer.parseInt(line);
            		first=false;
            	}else{
            		String[] str=line.split(" ");
            		int a=Integer.parseInt(str[0]);
            		int b=Integer.parseInt(str[1]);
            		int c=Integer.parseInt(str[2]);
            		int d=Integer.parseInt(str[3]);
            		card[(a-1)*3+b-1][c-1]+=d;
            		i++;
            		if(i==n){
            			for(int j=0;j<12;j++){
            				for(int l=0;l<10;l++){
            					System.out.print(" "+card[j][l]);
            				}
            				System.out.println("");
            				if((j+1)%3==0&&j!=11){
            					System.out.println("####################");
            				}
            			}
            			break;
            		}
                	
            	}
            }
        }
    }

} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {

	public static void main(String[] args) throws Exception {
        // TODO ?????????????????????????????????????????????
        
        boolean first=true;
        try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
            String line;
            int i=0,n=0;
            int[][] card=new int[12][10];
            while ((line = br.readLine()) != null) {
            	if(first){
            		n=Integer.parseInt(line);
            		first=false;
            	}else{
            		String[] str=line.split(" ");
            		int a=Integer.parseInt(str[0]);
            		int b=Integer.parseInt(str[1]);
            		int c=Integer.parseInt(str[2]);
            		int d=Integer.parseInt(str[3]);
            		card[(a-1)*3+b-1][c-1]+=d;
            		i++;
            		if(i==n){
            			for(int j=0;j<12;j++){
            				for(int l=0;l<10;l++){
            					System.out.print(" "+card[j][l]);
            				}
            				System.out.println("");
            				if((j+1)%3==0&&j!=11){
            					System.out.println("####################");
            				}
            			}
            			break;
            		}
                	
            	}
            }
        }
    }

}