You manage 4 buildings, each of which has 3 floors, each of which consists of 10 rooms. Write a program which reads a sequence of tenant/leaver notices, and reports the number of tenants for each room.  For each notice, you are given four integers b, f, r and v which represent that v persons entered to room r of fth floor at building b. If v is negative, it means that −v persons left.  Assume that initially no person lives in the building.
# -*- coding: utf-8 -*-

import sys
import os


def get_house():
    return [[0 for i in range(10)] for j in range(3)]

def print_house(h):
    for i in range(3):
        for j in range(10):
            print(' ', end='')
            print(h[i][j], end='')
        print()

houses = []
for i in range(4):
    houses.append(get_house())

N = int(input())
for i in range(N):
    b, f, r, v = list(map(int, input().split()))
    houses[b-1][f-1][r-1] += v

for i in range(4):
    print_house(houses[i])
    print('####################')
# -*- coding: utf-8 -*-

import sys
import os


def get_house():
    return [[0 for i in range(10)] for j in range(3)]

def print_house(h):
    for i in range(3):
        for j in range(10):
            print(' ', end='')
            print(h[i][j], end='')
        print()

houses = []
for i in range(4):
    houses.append(get_house())

N = int(input())
for i in range(N):
    b, f, r, v = list(map(int, input().split()))
    houses[b-1][f-1][r-1] += v

for i in range(4):
    print_house(houses[i])
    if i != 3:
        print('####################')