import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
	int [][][]kanri =new int[5][4][11];
	int tou,kai,heya,nin,x;
	Scanner sc = new Scanner(System.in);
	int n=sc.nextInt();
	for(x=1;x<=n;x++){
		tou=sc.nextInt();kai=sc.nextInt();
		heya=sc.nextInt();nin=sc.nextInt();
		kanri[tou][kai][heya]=kanri[tou][kai][heya]+nin;
	}
	for(tou=1;tou<=4;tou++){
		for(kai=1;kai<=3;kai++){
			for(heya=1;heya<=10;heya++){System.out.print(" "+kanri[tou][kai][heya]);}
			if(tou!=4&&kai==3){System.out.print("\n"+"####################");}
			System.out.print("\n");
		}
	}
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
	int [][][]kanri =new int[5][4][11];
	int tou,kai,heya,nin,x;
	Scanner sc = new Scanner(System.in);
	int n=sc.nextInt();
	for(x=1;x<=n;x++){
		tou=sc.nextInt();kai=sc.nextInt();
		heya=sc.nextInt();nin=sc.nextInt();
		kanri[tou][kai][heya]=kanri[tou][kai][heya]+nin;
	}
	for(tou=1;tou<=4;tou++){
		for(kai=1;kai<=3;kai++){
			for(heya=1;heya<=10;heya++){System.out.print(" "+kanri[tou][kai][heya]);}
			if(tou!=4&&kai==3){System.out.print("\n"+"####################");}
			System.out.print("\n");
		}
	}
	}
} Main public static void main(String[] args) {
	int [][][]kanri =new int[5][4][11];
	int tou,kai,heya,nin,x;
	Scanner sc = new Scanner(System.in);
	int n=sc.nextInt();
	for(x=1;x<=n;x++){
		tou=sc.nextInt();kai=sc.nextInt();
		heya=sc.nextInt();nin=sc.nextInt();
		kanri[tou][kai][heya]=kanri[tou][kai][heya]+nin;
	}
	for(tou=1;tou<=4;tou++){
		for(kai=1;kai<=3;kai++){
			for(heya=1;heya<=10;heya++){System.out.print(" "+kanri[tou][kai][heya]);}
			if(tou!=4&&kai==3){System.out.print("\n"+"####################");}
			System.out.print("\n");
		}
	}
	} main {
	int [][][]kanri =new int[5][4][11];
	int tou,kai,heya,nin,x;
	Scanner sc = new Scanner(System.in);
	int n=sc.nextInt();
	for(x=1;x<=n;x++){
		tou=sc.nextInt();kai=sc.nextInt();
		heya=sc.nextInt();nin=sc.nextInt();
		kanri[tou][kai][heya]=kanri[tou][kai][heya]+nin;
	}
	for(tou=1;tou<=4;tou++){
		for(kai=1;kai<=3;kai++){
			for(heya=1;heya<=10;heya++){System.out.print(" "+kanri[tou][kai][heya]);}
			if(tou!=4&&kai==3){System.out.print("\n"+"####################");}
			System.out.print("\n");
		}
	}
	} int [][][]kanri =new int[5][4][11]; kanri new int[5][4][11] 5 4 11 int tou tou kai kai heya heya nin nin x; x Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n=sc.nextInt(); n sc.nextInt() sc.nextInt sc for(x=1;x<=n;x++){
		tou=sc.nextInt();kai=sc.nextInt();
		heya=sc.nextInt();nin=sc.nextInt();
		kanri[tou][kai][heya]=kanri[tou][kai][heya]+nin;
	} x=1; x=1 x 1 x<=n x n x++ x++ x {
		tou=sc.nextInt();kai=sc.nextInt();
		heya=sc.nextInt();nin=sc.nextInt();
		kanri[tou][kai][heya]=kanri[tou][kai][heya]+nin;
	} {
		tou=sc.nextInt();kai=sc.nextInt();
		heya=sc.nextInt();nin=sc.nextInt();
		kanri[tou][kai][heya]=kanri[tou][kai][heya]+nin;
	} tou=sc.nextInt() tou sc.nextInt() sc.nextInt sc kai=sc.nextInt() kai sc.nextInt() sc.nextInt sc heya=sc.nextInt() heya sc.nextInt() sc.nextInt sc nin=sc.nextInt() nin sc.nextInt() sc.nextInt sc kanri[tou][kai][heya]=kanri[tou][kai][heya]+nin kanri[tou][kai][heya] kanri[tou][kai] kanri[tou] kanri tou kai heya kanri[tou][kai][heya]+nin kanri[tou][kai][heya] kanri[tou][kai] kanri[tou] kanri tou kai heya nin for(tou=1;tou<=4;tou++){
		for(kai=1;kai<=3;kai++){
			for(heya=1;heya<=10;heya++){System.out.print(" "+kanri[tou][kai][heya]);}
			if(tou!=4&&kai==3){System.out.print("\n"+"####################");}
			System.out.print("\n");
		}
	} tou=1; tou=1 tou 1 tou<=4 tou 4 tou++ tou++ tou {
		for(kai=1;kai<=3;kai++){
			for(heya=1;heya<=10;heya++){System.out.print(" "+kanri[tou][kai][heya]);}
			if(tou!=4&&kai==3){System.out.print("\n"+"####################");}
			System.out.print("\n");
		}
	} {
		for(kai=1;kai<=3;kai++){
			for(heya=1;heya<=10;heya++){System.out.print(" "+kanri[tou][kai][heya]);}
			if(tou!=4&&kai==3){System.out.print("\n"+"####################");}
			System.out.print("\n");
		}
	} for(kai=1;kai<=3;kai++){
			for(heya=1;heya<=10;heya++){System.out.print(" "+kanri[tou][kai][heya]);}
			if(tou!=4&&kai==3){System.out.print("\n"+"####################");}
			System.out.print("\n");
		} kai=1; kai=1 kai 1 kai<=3 kai 3 kai++ kai++ kai {
			for(heya=1;heya<=10;heya++){System.out.print(" "+kanri[tou][kai][heya]);}
			if(tou!=4&&kai==3){System.out.print("\n"+"####################");}
			System.out.print("\n");
		} {
			for(heya=1;heya<=10;heya++){System.out.print(" "+kanri[tou][kai][heya]);}
			if(tou!=4&&kai==3){System.out.print("\n"+"####################");}
			System.out.print("\n");
		} for(heya=1;heya<=10;heya++){System.out.print(" "+kanri[tou][kai][heya]);} heya=1; heya=1 heya 1 heya<=10 heya 10 heya++ heya++ heya {System.out.print(" "+kanri[tou][kai][heya]);} {System.out.print(" "+kanri[tou][kai][heya]);} System.out.print(" "+kanri[tou][kai][heya]) System.out.print System.out System System.out " "+kanri[tou][kai][heya] " " kanri[tou][kai][heya] kanri[tou][kai] kanri[tou] kanri tou kai heya if(tou!=4&&kai==3){System.out.print("\n"+"####################");} tou!=4&&kai==3 tou!=4 tou 4 kai==3 kai 3 {System.out.print("\n"+"####################");} System.out.print("\n"+"####################") System.out.print System.out System System.out "\n"+"####################" "\n" "####################" System.out.print("\n") System.out.print System.out System System.out "\n" String[] args args public class Main {
	public static void main(String[] args) {
	int [][][]kanri =new int[5][4][11];
	int tou,kai,heya,nin,x;
	Scanner sc = new Scanner(System.in);
	int n=sc.nextInt();
	for(x=1;x<=n;x++){
		tou=sc.nextInt();kai=sc.nextInt();
		heya=sc.nextInt();nin=sc.nextInt();
		kanri[tou][kai][heya]=kanri[tou][kai][heya]+nin;
	}
	for(tou=1;tou<=4;tou++){
		for(kai=1;kai<=3;kai++){
			for(heya=1;heya<=10;heya++){System.out.print(" "+kanri[tou][kai][heya]);}
			if(tou!=4&&kai==3){System.out.print("\n"+"####################");}
			System.out.print("\n");
		}
	}
	}
} public class Main {
	public static void main(String[] args) {
	int [][][]kanri =new int[5][4][11];
	int tou,kai,heya,nin,x;
	Scanner sc = new Scanner(System.in);
	int n=sc.nextInt();
	for(x=1;x<=n;x++){
		tou=sc.nextInt();kai=sc.nextInt();
		heya=sc.nextInt();nin=sc.nextInt();
		kanri[tou][kai][heya]=kanri[tou][kai][heya]+nin;
	}
	for(tou=1;tou<=4;tou++){
		for(kai=1;kai<=3;kai++){
			for(heya=1;heya<=10;heya++){System.out.print(" "+kanri[tou][kai][heya]);}
			if(tou!=4&&kai==3){System.out.print("\n"+"####################");}
			System.out.print("\n");
		}
	}
	}
} Main
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
	int [][][]kanri =new int[5][4][11];
	int tou,kai,heya,nin,x;
	Scanner sc = new Scanner(System.in);
	int n=sc.nextInt();
	for(x=1;x<=n;x++){
		tou=sc.nextInt();kai=sc.nextInt();
		heya=sc.nextInt();nin=sc.nextInt();
		kanri[tou][kai][heya]=kanri[tou][kai][heya]+nin;
	}
	for(tou=1;tou<=4;tou++){
		for(kai=1;kai<=3;kai++){
			for(heya=1;heya<=10;heya++){System.out.print(" "+kanri[tou][kai][heya]);}
			if(tou!=4&&kai==3){System.out.print("\n"+"####################");}
			System.out.print("\n");
		}
	}
	}
}