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");
		}
	}
	}
}
/tmp/hf-datasets-cache/medium/datasets/42704881117311-config-parquet-and-info-qiankunmu-Project_CodeNet-896c9d36/hub/datasets--qiankunmu--Project_CodeNet_Python800_and_Java250/snapshots/c899fde44a77ba1cc14973ed3de064e4ff3aadc7/Project_CodeNet_Java250.tar.gz