import java.util.*;

public class Main {
    private static final Scanner scn = new Scanner(System.in);
    private static final String WALL = "####################";
    
    public static void main(String[] args) {
        int[][][] tbl = new int[4][3][10];
        for(int n = scn.nextInt(); n > 0; n--) {
            int b = load(), f = load(), r = load();
            tbl[b][f][r] += scn.nextInt();
        }
        for(int i = 0; i < 4; i++) {
            if(i > 0) {
                System.out.println(WALL);
            }
            print(tbl[i]);
        }
    }
    
    private static int load() {
        return scn.nextInt() - 1;
    }
    
    private static void print(int[][] tbl) {
        for(int[] ary : tbl) {
            for(int elm : ary) {
                System.out.format("%2d", elm);
            }
            System.out.println();
        }
    }
} import java.util.*; util.* java public class Main {
    private static final Scanner scn = new Scanner(System.in);
    private static final String WALL = "####################";
    
    public static void main(String[] args) {
        int[][][] tbl = new int[4][3][10];
        for(int n = scn.nextInt(); n > 0; n--) {
            int b = load(), f = load(), r = load();
            tbl[b][f][r] += scn.nextInt();
        }
        for(int i = 0; i < 4; i++) {
            if(i > 0) {
                System.out.println(WALL);
            }
            print(tbl[i]);
        }
    }
    
    private static int load() {
        return scn.nextInt() - 1;
    }
    
    private static void print(int[][] tbl) {
        for(int[] ary : tbl) {
            for(int elm : ary) {
                System.out.format("%2d", elm);
            }
            System.out.println();
        }
    }
} Main private static final Scanner scn = new Scanner(System.in); scn new Scanner(System.in) private static final String WALL = "####################"; WALL "####################" public static void main(String[] args) {
        int[][][] tbl = new int[4][3][10];
        for(int n = scn.nextInt(); n > 0; n--) {
            int b = load(), f = load(), r = load();
            tbl[b][f][r] += scn.nextInt();
        }
        for(int i = 0; i < 4; i++) {
            if(i > 0) {
                System.out.println(WALL);
            }
            print(tbl[i]);
        }
    } main {
        int[][][] tbl = new int[4][3][10];
        for(int n = scn.nextInt(); n > 0; n--) {
            int b = load(), f = load(), r = load();
            tbl[b][f][r] += scn.nextInt();
        }
        for(int i = 0; i < 4; i++) {
            if(i > 0) {
                System.out.println(WALL);
            }
            print(tbl[i]);
        }
    } int[][][] tbl = new int[4][3][10]; tbl new int[4][3][10] 4 3 10 for(int n = scn.nextInt(); n > 0; n--) {
            int b = load(), f = load(), r = load();
            tbl[b][f][r] += scn.nextInt();
        } int n = scn.nextInt(); int n = scn.nextInt(); n scn.nextInt() scn.nextInt scn n > 0 n 0 n-- n-- n {
            int b = load(), f = load(), r = load();
            tbl[b][f][r] += scn.nextInt();
        } {
            int b = load(), f = load(), r = load();
            tbl[b][f][r] += scn.nextInt();
        } int b = load() b load() load f = load() f load() load r = load(); r load() load tbl[b][f][r] += scn.nextInt() tbl[b][f][r] tbl[b][f] tbl[b] tbl b f r scn.nextInt() scn.nextInt scn for(int i = 0; i < 4; i++) {
            if(i > 0) {
                System.out.println(WALL);
            }
            print(tbl[i]);
        } int i = 0; int i = 0; i 0 i < 4 i 4 i++ i++ i {
            if(i > 0) {
                System.out.println(WALL);
            }
            print(tbl[i]);
        } {
            if(i > 0) {
                System.out.println(WALL);
            }
            print(tbl[i]);
        } if(i > 0) {
                System.out.println(WALL);
            } i > 0 i 0 {
                System.out.println(WALL);
            } System.out.println(WALL) System.out.println System.out System System.out WALL print(tbl[i]) print tbl[i] tbl i String[] args args private static int load() {
        return scn.nextInt() - 1;
    } load {
        return scn.nextInt() - 1;
    } return scn.nextInt() - 1; scn.nextInt() - 1 scn.nextInt() scn.nextInt scn 1 private static void print(int[][] tbl) {
        for(int[] ary : tbl) {
            for(int elm : ary) {
                System.out.format("%2d", elm);
            }
            System.out.println();
        }
    } print {
        for(int[] ary : tbl) {
            for(int elm : ary) {
                System.out.format("%2d", elm);
            }
            System.out.println();
        }
    } for(int[] ary : tbl) {
            for(int elm : ary) {
                System.out.format("%2d", elm);
            }
            System.out.println();
        } int[] ary tbl {
            for(int elm : ary) {
                System.out.format("%2d", elm);
            }
            System.out.println();
        } {
            for(int elm : ary) {
                System.out.format("%2d", elm);
            }
            System.out.println();
        } for(int elm : ary) {
                System.out.format("%2d", elm);
            } int elm ary {
                System.out.format("%2d", elm);
            } {
                System.out.format("%2d", elm);
            } System.out.format("%2d", elm) System.out.format System.out System System.out "%2d" elm System.out.println() System.out.println System.out System System.out int[][] tbl tbl public class Main {
    private static final Scanner scn = new Scanner(System.in);
    private static final String WALL = "####################";
    
    public static void main(String[] args) {
        int[][][] tbl = new int[4][3][10];
        for(int n = scn.nextInt(); n > 0; n--) {
            int b = load(), f = load(), r = load();
            tbl[b][f][r] += scn.nextInt();
        }
        for(int i = 0; i < 4; i++) {
            if(i > 0) {
                System.out.println(WALL);
            }
            print(tbl[i]);
        }
    }
    
    private static int load() {
        return scn.nextInt() - 1;
    }
    
    private static void print(int[][] tbl) {
        for(int[] ary : tbl) {
            for(int elm : ary) {
                System.out.format("%2d", elm);
            }
            System.out.println();
        }
    }
} public class Main {
    private static final Scanner scn = new Scanner(System.in);
    private static final String WALL = "####################";
    
    public static void main(String[] args) {
        int[][][] tbl = new int[4][3][10];
        for(int n = scn.nextInt(); n > 0; n--) {
            int b = load(), f = load(), r = load();
            tbl[b][f][r] += scn.nextInt();
        }
        for(int i = 0; i < 4; i++) {
            if(i > 0) {
                System.out.println(WALL);
            }
            print(tbl[i]);
        }
    }
    
    private static int load() {
        return scn.nextInt() - 1;
    }
    
    private static void print(int[][] tbl) {
        for(int[] ary : tbl) {
            for(int elm : ary) {
                System.out.format("%2d", elm);
            }
            System.out.println();
        }
    }
} Main
import java.util.*;

public class Main {
    private static final Scanner scn = new Scanner(System.in);
    private static final String WALL = "####################";
    
    public static void main(String[] args) {
        int[][][] tbl = new int[4][3][10];
        for(int n = scn.nextInt(); n > 0; n--) {
            int b = load(), f = load(), r = load();
            tbl[b][f][r] += scn.nextInt();
        }
        for(int i = 0; i < 4; i++) {
            if(i > 0) {
                System.out.println(WALL);
            }
            print(tbl[i]);
        }
    }
    
    private static int load() {
        return scn.nextInt() - 1;
    }
    
    private static void print(int[][] tbl) {
        for(int[] ary : tbl) {
            for(int elm : ary) {
                System.out.format("%2d", elm);
            }
            System.out.println();
        }
    }
}