import java.util.Scanner;

public class Main
{
    public static void main(String[] args)
    {
        Scanner sc = new Scanner(System.in);
        
        int[][][] hito = new int[4][3][10];
        
        int n = sc.nextInt();
        
        for (int i = 0; i < n; i++) {
        	int b = sc.nextInt();
            int f = sc.nextInt();
            int r = sc.nextInt();
            int v = sc.nextInt();
            
            hito[b-1][f-1][r-1] += v;
            
            
        }
        
        for (int i = 0; i < 4; i++) {
            for (int j = 0 ; j < 3; j++) {
            	for (int k = 0 ; k < 10; k++) {
            		if (k != 9) {
                        System.out.printf(" %d", hito[i][j][k]);
                    }
                    else {
                        System.out.printf(" %d\n", hito[i][j][k]);
            	}
                }
            }
            if (i != 3) {
                System.out.println("####################");
            }
        }
    }
} import java.util.Scanner; Scanner java.util public class Main
{
    public static void main(String[] args)
    {
        Scanner sc = new Scanner(System.in);
        
        int[][][] hito = new int[4][3][10];
        
        int n = sc.nextInt();
        
        for (int i = 0; i < n; i++) {
        	int b = sc.nextInt();
            int f = sc.nextInt();
            int r = sc.nextInt();
            int v = sc.nextInt();
            
            hito[b-1][f-1][r-1] += v;
            
            
        }
        
        for (int i = 0; i < 4; i++) {
            for (int j = 0 ; j < 3; j++) {
            	for (int k = 0 ; k < 10; k++) {
            		if (k != 9) {
                        System.out.printf(" %d", hito[i][j][k]);
                    }
                    else {
                        System.out.printf(" %d\n", hito[i][j][k]);
            	}
                }
            }
            if (i != 3) {
                System.out.println("####################");
            }
        }
    }
} Main public static void main(String[] args)
    {
        Scanner sc = new Scanner(System.in);
        
        int[][][] hito = new int[4][3][10];
        
        int n = sc.nextInt();
        
        for (int i = 0; i < n; i++) {
        	int b = sc.nextInt();
            int f = sc.nextInt();
            int r = sc.nextInt();
            int v = sc.nextInt();
            
            hito[b-1][f-1][r-1] += v;
            
            
        }
        
        for (int i = 0; i < 4; i++) {
            for (int j = 0 ; j < 3; j++) {
            	for (int k = 0 ; k < 10; k++) {
            		if (k != 9) {
                        System.out.printf(" %d", hito[i][j][k]);
                    }
                    else {
                        System.out.printf(" %d\n", hito[i][j][k]);
            	}
                }
            }
            if (i != 3) {
                System.out.println("####################");
            }
        }
    } main {
        Scanner sc = new Scanner(System.in);
        
        int[][][] hito = new int[4][3][10];
        
        int n = sc.nextInt();
        
        for (int i = 0; i < n; i++) {
        	int b = sc.nextInt();
            int f = sc.nextInt();
            int r = sc.nextInt();
            int v = sc.nextInt();
            
            hito[b-1][f-1][r-1] += v;
            
            
        }
        
        for (int i = 0; i < 4; i++) {
            for (int j = 0 ; j < 3; j++) {
            	for (int k = 0 ; k < 10; k++) {
            		if (k != 9) {
                        System.out.printf(" %d", hito[i][j][k]);
                    }
                    else {
                        System.out.printf(" %d\n", hito[i][j][k]);
            	}
                }
            }
            if (i != 3) {
                System.out.println("####################");
            }
        }
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int[][][] hito = new int[4][3][10]; hito new int[4][3][10] 4 3 10 int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc for (int i = 0; i < n; i++) {
        	int b = sc.nextInt();
            int f = sc.nextInt();
            int r = sc.nextInt();
            int v = sc.nextInt();
            
            hito[b-1][f-1][r-1] += v;
            
            
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
        	int b = sc.nextInt();
            int f = sc.nextInt();
            int r = sc.nextInt();
            int v = sc.nextInt();
            
            hito[b-1][f-1][r-1] += v;
            
            
        } {
        	int b = sc.nextInt();
            int f = sc.nextInt();
            int r = sc.nextInt();
            int v = sc.nextInt();
            
            hito[b-1][f-1][r-1] += v;
            
            
        } int b = sc.nextInt(); b sc.nextInt() sc.nextInt sc int f = sc.nextInt(); f sc.nextInt() sc.nextInt sc int r = sc.nextInt(); r sc.nextInt() sc.nextInt sc int v = sc.nextInt(); v sc.nextInt() sc.nextInt sc hito[b-1][f-1][r-1] += v hito[b-1][f-1][r-1] hito[b-1][f-1] hito[b-1] hito b-1 b 1 f-1 f 1 r-1 r 1 v for (int i = 0; i < 4; i++) {
            for (int j = 0 ; j < 3; j++) {
            	for (int k = 0 ; k < 10; k++) {
            		if (k != 9) {
                        System.out.printf(" %d", hito[i][j][k]);
                    }
                    else {
                        System.out.printf(" %d\n", hito[i][j][k]);
            	}
                }
            }
            if (i != 3) {
                System.out.println("####################");
            }
        } int i = 0; int i = 0; i 0 i < 4 i 4 i++ i++ i {
            for (int j = 0 ; j < 3; j++) {
            	for (int k = 0 ; k < 10; k++) {
            		if (k != 9) {
                        System.out.printf(" %d", hito[i][j][k]);
                    }
                    else {
                        System.out.printf(" %d\n", hito[i][j][k]);
            	}
                }
            }
            if (i != 3) {
                System.out.println("####################");
            }
        } {
            for (int j = 0 ; j < 3; j++) {
            	for (int k = 0 ; k < 10; k++) {
            		if (k != 9) {
                        System.out.printf(" %d", hito[i][j][k]);
                    }
                    else {
                        System.out.printf(" %d\n", hito[i][j][k]);
            	}
                }
            }
            if (i != 3) {
                System.out.println("####################");
            }
        } for (int j = 0 ; j < 3; j++) {
            	for (int k = 0 ; k < 10; k++) {
            		if (k != 9) {
                        System.out.printf(" %d", hito[i][j][k]);
                    }
                    else {
                        System.out.printf(" %d\n", hito[i][j][k]);
            	}
                }
            } int j = 0 ; int j = 0 ; j 0 j < 3 j 3 j++ j++ j {
            	for (int k = 0 ; k < 10; k++) {
            		if (k != 9) {
                        System.out.printf(" %d", hito[i][j][k]);
                    }
                    else {
                        System.out.printf(" %d\n", hito[i][j][k]);
            	}
                }
            } {
            	for (int k = 0 ; k < 10; k++) {
            		if (k != 9) {
                        System.out.printf(" %d", hito[i][j][k]);
                    }
                    else {
                        System.out.printf(" %d\n", hito[i][j][k]);
            	}
                }
            } for (int k = 0 ; k < 10; k++) {
            		if (k != 9) {
                        System.out.printf(" %d", hito[i][j][k]);
                    }
                    else {
                        System.out.printf(" %d\n", hito[i][j][k]);
            	}
                } int k = 0 ; int k = 0 ; k 0 k < 10 k 10 k++ k++ k {
            		if (k != 9) {
                        System.out.printf(" %d", hito[i][j][k]);
                    }
                    else {
                        System.out.printf(" %d\n", hito[i][j][k]);
            	}
                } {
            		if (k != 9) {
                        System.out.printf(" %d", hito[i][j][k]);
                    }
                    else {
                        System.out.printf(" %d\n", hito[i][j][k]);
            	}
                } if (k != 9) {
                        System.out.printf(" %d", hito[i][j][k]);
                    }
                    else {
                        System.out.printf(" %d\n", hito[i][j][k]);
            	} k != 9 k 9 {
                        System.out.printf(" %d", hito[i][j][k]);
                    } System.out.printf(" %d", hito[i][j][k]) System.out.printf System.out System System.out " %d" hito[i][j][k] hito[i][j] hito[i] hito i j k {
                        System.out.printf(" %d\n", hito[i][j][k]);
            	} System.out.printf(" %d\n", hito[i][j][k]) System.out.printf System.out System System.out " %d\n" hito[i][j][k] hito[i][j] hito[i] hito i j k if (i != 3) {
                System.out.println("####################");
            } i != 3 i 3 {
                System.out.println("####################");
            } System.out.println("####################") System.out.println System.out System System.out "####################" String[] args args public class Main
{
    public static void main(String[] args)
    {
        Scanner sc = new Scanner(System.in);
        
        int[][][] hito = new int[4][3][10];
        
        int n = sc.nextInt();
        
        for (int i = 0; i < n; i++) {
        	int b = sc.nextInt();
            int f = sc.nextInt();
            int r = sc.nextInt();
            int v = sc.nextInt();
            
            hito[b-1][f-1][r-1] += v;
            
            
        }
        
        for (int i = 0; i < 4; i++) {
            for (int j = 0 ; j < 3; j++) {
            	for (int k = 0 ; k < 10; k++) {
            		if (k != 9) {
                        System.out.printf(" %d", hito[i][j][k]);
                    }
                    else {
                        System.out.printf(" %d\n", hito[i][j][k]);
            	}
                }
            }
            if (i != 3) {
                System.out.println("####################");
            }
        }
    }
} public class Main
{
    public static void main(String[] args)
    {
        Scanner sc = new Scanner(System.in);
        
        int[][][] hito = new int[4][3][10];
        
        int n = sc.nextInt();
        
        for (int i = 0; i < n; i++) {
        	int b = sc.nextInt();
            int f = sc.nextInt();
            int r = sc.nextInt();
            int v = sc.nextInt();
            
            hito[b-1][f-1][r-1] += v;
            
            
        }
        
        for (int i = 0; i < 4; i++) {
            for (int j = 0 ; j < 3; j++) {
            	for (int k = 0 ; k < 10; k++) {
            		if (k != 9) {
                        System.out.printf(" %d", hito[i][j][k]);
                    }
                    else {
                        System.out.printf(" %d\n", hito[i][j][k]);
            	}
                }
            }
            if (i != 3) {
                System.out.println("####################");
            }
        }
    }
} Main
import java.util.Scanner;

public class Main
{
    public static void main(String[] args)
    {
        Scanner sc = new Scanner(System.in);
        
        int[][][] hito = new int[4][3][10];
        
        int n = sc.nextInt();
        
        for (int i = 0; i < n; i++) {
        	int b = sc.nextInt();
            int f = sc.nextInt();
            int r = sc.nextInt();
            int v = sc.nextInt();
            
            hito[b-1][f-1][r-1] += v;
            
            
        }
        
        for (int i = 0; i < 4; i++) {
            for (int j = 0 ; j < 3; j++) {
            	for (int k = 0 ; k < 10; k++) {
            		if (k != 9) {
                        System.out.printf(" %d", hito[i][j][k]);
                    }
                    else {
                        System.out.printf(" %d\n", hito[i][j][k]);
            	}
                }
            }
            if (i != 3) {
                System.out.println("####################");
            }
        }
    }
}
