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.
n = int(input())

arrey = [[[0 for r in range(10)]for f in range(3)]for b in range(4)]

for i in range(n):
    b, f, r, v = [int(j) for j in input().split()]
    arrey[b-1][f-1][r-1] = v

for b in range(len(arrey)):
    for f in range(len(arrey[b])):
        for r in range(len(arrey[b][f])):
            print(str(arrey[b][f][r])+' ',end='') if r != len(arrey[b][f]) - 1 else print(arrey[b][f][r])
    print('########################')
n = int(input())

arrey = [[[0 for r in range(10)]for f in range(3)]for b in range(4)]

for i in range(n):
    b, f, r, v = [int(j) for j in input().split()]
    arrey[b-1][f-1][r-1] = arrey[b-1][f-1][r-1] + v

for b in range(len(arrey)):
    for f in range(len(arrey[b])):
        for r in range(len(arrey[b][f])):
            print(' ' + str(arrey[b][f][r]),end='') if r != len(arrey[b][f]) - 1 else print(' ' + str(arrey[b][f][r]))
    if b != len(arrey) - 1:
        print('####################')