import java.util.*;

public class Main {
    private static final String lin = "####################";

    public static void main(String[] args) {
        Scanner scn = new Scanner(System.in);
        int[][][] tbl = new int[4][3][10];
        for(int i = 0, n = scn.nextInt(); i < n; i++) {
            int b = scn.nextInt(), f = scn.nextInt();
            int r = scn.nextInt(), v = scn.nextInt();
            tbl[~-b][~-f][~-r] += v;
        }
        for(int b = 0; b < 4; b++) {
            for(int f = 0; f < 3; f++) {
                for(int r = 0; r < 10; r++) {
                    System.out.print(" " + tbl[b][f][r]);
                }
                System.out.println();
            }
            if(b < 3) {
                System.out.println(lin);
            }
        }
    }
} import java.util.*; util.* java public class Main {
    private static final String lin = "####################";

    public static void main(String[] args) {
        Scanner scn = new Scanner(System.in);
        int[][][] tbl = new int[4][3][10];
        for(int i = 0, n = scn.nextInt(); i < n; i++) {
            int b = scn.nextInt(), f = scn.nextInt();
            int r = scn.nextInt(), v = scn.nextInt();
            tbl[~-b][~-f][~-r] += v;
        }
        for(int b = 0; b < 4; b++) {
            for(int f = 0; f < 3; f++) {
                for(int r = 0; r < 10; r++) {
                    System.out.print(" " + tbl[b][f][r]);
                }
                System.out.println();
            }
            if(b < 3) {
                System.out.println(lin);
            }
        }
    }
} Main private static final String lin = "####################"; lin "####################" public static void main(String[] args) {
        Scanner scn = new Scanner(System.in);
        int[][][] tbl = new int[4][3][10];
        for(int i = 0, n = scn.nextInt(); i < n; i++) {
            int b = scn.nextInt(), f = scn.nextInt();
            int r = scn.nextInt(), v = scn.nextInt();
            tbl[~-b][~-f][~-r] += v;
        }
        for(int b = 0; b < 4; b++) {
            for(int f = 0; f < 3; f++) {
                for(int r = 0; r < 10; r++) {
                    System.out.print(" " + tbl[b][f][r]);
                }
                System.out.println();
            }
            if(b < 3) {
                System.out.println(lin);
            }
        }
    } main {
        Scanner scn = new Scanner(System.in);
        int[][][] tbl = new int[4][3][10];
        for(int i = 0, n = scn.nextInt(); i < n; i++) {
            int b = scn.nextInt(), f = scn.nextInt();
            int r = scn.nextInt(), v = scn.nextInt();
            tbl[~-b][~-f][~-r] += v;
        }
        for(int b = 0; b < 4; b++) {
            for(int f = 0; f < 3; f++) {
                for(int r = 0; r < 10; r++) {
                    System.out.print(" " + tbl[b][f][r]);
                }
                System.out.println();
            }
            if(b < 3) {
                System.out.println(lin);
            }
        }
    } Scanner scn = new Scanner(System.in); scn new Scanner(System.in) int[][][] tbl = new int[4][3][10]; tbl new int[4][3][10] 4 3 10 for(int i = 0, n = scn.nextInt(); i < n; i++) {
            int b = scn.nextInt(), f = scn.nextInt();
            int r = scn.nextInt(), v = scn.nextInt();
            tbl[~-b][~-f][~-r] += v;
        } int i = 0, n = scn.nextInt(); int i = 0 i 0 n = scn.nextInt(); n scn.nextInt() scn.nextInt scn i < n i n i++ i++ i {
            int b = scn.nextInt(), f = scn.nextInt();
            int r = scn.nextInt(), v = scn.nextInt();
            tbl[~-b][~-f][~-r] += v;
        } {
            int b = scn.nextInt(), f = scn.nextInt();
            int r = scn.nextInt(), v = scn.nextInt();
            tbl[~-b][~-f][~-r] += v;
        } int b = scn.nextInt() b scn.nextInt() scn.nextInt scn f = scn.nextInt(); f scn.nextInt() scn.nextInt scn int r = scn.nextInt() r scn.nextInt() scn.nextInt scn v = scn.nextInt(); v scn.nextInt() scn.nextInt scn tbl[~-b][~-f][~-r] += v tbl[~-b][~-f][~-r] tbl[~-b][~-f] tbl[~-b] tbl ~-b -b b ~-f -f f ~-r -r r v for(int b = 0; b < 4; b++) {
            for(int f = 0; f < 3; f++) {
                for(int r = 0; r < 10; r++) {
                    System.out.print(" " + tbl[b][f][r]);
                }
                System.out.println();
            }
            if(b < 3) {
                System.out.println(lin);
            }
        } int b = 0; int b = 0; b 0 b < 4 b 4 b++ b++ b {
            for(int f = 0; f < 3; f++) {
                for(int r = 0; r < 10; r++) {
                    System.out.print(" " + tbl[b][f][r]);
                }
                System.out.println();
            }
            if(b < 3) {
                System.out.println(lin);
            }
        } {
            for(int f = 0; f < 3; f++) {
                for(int r = 0; r < 10; r++) {
                    System.out.print(" " + tbl[b][f][r]);
                }
                System.out.println();
            }
            if(b < 3) {
                System.out.println(lin);
            }
        } for(int f = 0; f < 3; f++) {
                for(int r = 0; r < 10; r++) {
                    System.out.print(" " + tbl[b][f][r]);
                }
                System.out.println();
            } int f = 0; int f = 0; f 0 f < 3 f 3 f++ f++ f {
                for(int r = 0; r < 10; r++) {
                    System.out.print(" " + tbl[b][f][r]);
                }
                System.out.println();
            } {
                for(int r = 0; r < 10; r++) {
                    System.out.print(" " + tbl[b][f][r]);
                }
                System.out.println();
            } for(int r = 0; r < 10; r++) {
                    System.out.print(" " + tbl[b][f][r]);
                } int r = 0; int r = 0; r 0 r < 10 r 10 r++ r++ r {
                    System.out.print(" " + tbl[b][f][r]);
                } {
                    System.out.print(" " + tbl[b][f][r]);
                } System.out.print(" " + tbl[b][f][r]) System.out.print System.out System System.out " " + tbl[b][f][r] " " tbl[b][f][r] tbl[b][f] tbl[b] tbl b f r System.out.println() System.out.println System.out System System.out if(b < 3) {
                System.out.println(lin);
            } b < 3 b 3 {
                System.out.println(lin);
            } System.out.println(lin) System.out.println System.out System System.out lin String[] args args public class Main {
    private static final String lin = "####################";

    public static void main(String[] args) {
        Scanner scn = new Scanner(System.in);
        int[][][] tbl = new int[4][3][10];
        for(int i = 0, n = scn.nextInt(); i < n; i++) {
            int b = scn.nextInt(), f = scn.nextInt();
            int r = scn.nextInt(), v = scn.nextInt();
            tbl[~-b][~-f][~-r] += v;
        }
        for(int b = 0; b < 4; b++) {
            for(int f = 0; f < 3; f++) {
                for(int r = 0; r < 10; r++) {
                    System.out.print(" " + tbl[b][f][r]);
                }
                System.out.println();
            }
            if(b < 3) {
                System.out.println(lin);
            }
        }
    }
} public class Main {
    private static final String lin = "####################";

    public static void main(String[] args) {
        Scanner scn = new Scanner(System.in);
        int[][][] tbl = new int[4][3][10];
        for(int i = 0, n = scn.nextInt(); i < n; i++) {
            int b = scn.nextInt(), f = scn.nextInt();
            int r = scn.nextInt(), v = scn.nextInt();
            tbl[~-b][~-f][~-r] += v;
        }
        for(int b = 0; b < 4; b++) {
            for(int f = 0; f < 3; f++) {
                for(int r = 0; r < 10; r++) {
                    System.out.print(" " + tbl[b][f][r]);
                }
                System.out.println();
            }
            if(b < 3) {
                System.out.println(lin);
            }
        }
    }
} Main
import java.util.*;

public class Main {
    private static final String lin = "####################";

    public static void main(String[] args) {
        Scanner scn = new Scanner(System.in);
        int[][][] tbl = new int[4][3][10];
        for(int i = 0, n = scn.nextInt(); i < n; i++) {
            int b = scn.nextInt(), f = scn.nextInt();
            int r = scn.nextInt(), v = scn.nextInt();
            tbl[~-b][~-f][~-r] += v;
        }
        for(int b = 0; b < 4; b++) {
            for(int f = 0; f < 3; f++) {
                for(int r = 0; r < 10; r++) {
                    System.out.print(" " + tbl[b][f][r]);
                }
                System.out.println();
            }
            if(b < 3) {
                System.out.println(lin);
            }
        }
    }
}