Problem:

Official House

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 &minus;v persons left.

Assume that initially no person lives in the building. 

Input

  In the first line, the number of notices n is given. In the following n lines, a set of four integers b, f, r and v which represents ith notice is given in a line. 

Output

For each building, print the information of 1st, 2nd and 3rd floor in this order. For each floor information, print the number of tenants of 1st, 2nd, .. and 10th room in this order. Print a single space character before the number of tenants. Print "####################" (20 '#') between buildings.

Constraints

No incorrect building, floor and room numbers are given.

0 ≤ the number of tenants during the management ≤ 9

Sample Input

3
1 1 3 8
3 2 2 7
4 3 8 1

Sample Output

 0 0 8 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
####################
 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
####################
 0 0 0 0 0 0 0 0 0 0
 0 7 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
####################
 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 1 0 0



Sample input:
3
1 1 3 8
3 2 2 7
4 3 8 1


Sample output:
 0 0 8 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
####################
 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
####################
 0 0 0 0 0 0 0 0 0 0
 0 7 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
####################
 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 1 0 0

Submission status: WA: Presentation Error

Solution code:
n = int(input())
move = []
first = []
second = []
third = []
forth = []

for p in range(3):
    first.append([0, 0, 0, 0, 0, 0, 0, 0, 0, 0])

for q in range(3):
    second.append([0, 0, 0, 0, 0, 0, 0, 0, 0, 0])
    
for r in range(3):
    third.append([0, 0, 0, 0, 0, 0, 0, 0, 0, 0])
    
for s in range(3):
    forth.append([0, 0, 0, 0, 0, 0, 0, 0, 0, 0])

for i in range(n):
    move.append(list(map(int, input().split())))

for j in move:
    f = j[1] - 1
    r = j[2] - 1
    if j[0] == 1:
        first[f][r] += j[3]
    elif j[0] == 2:
        second[f][r] += j[3]
    elif j[0] == 3:
        third[f][r] += j[3]
    else:
        forth[f][r] += j[3]

for i in range(3):
    print(' '.join(map(str, first[i])))

print("#" * 20)

for i in range(3):
    print(' '.join(map(str, second[i])))
    
print("#" * 20)

for i in range(3):
    print(' '.join(map(str, third[i])))
    
print("#" * 20)

for i in range(3):
    print(' '.join(map(str, forth[i])))

Submission status: WA: Presentation Error

Solution code:
mansyon = [
    [
        [0,0,0,0,0,0,0,0,0,0],
        [0,0,0,0,0,0,0,0,0,0],
        [0,0,0,0,0,0,0,0,0,0]
    ],
    [
        [0,0,0,0,0,0,0,0,0,0],
        [0,0,0,0,0,0,0,0,0,0],
        [0,0,0,0,0,0,0,0,0,0]
    ],
    [
        [0,0,0,0,0,0,0,0,0,0],
        [0,0,0,0,0,0,0,0,0,0],
        [0,0,0,0,0,0,0,0,0,0]
    ],
    [
        [0,0,0,0,0,0,0,0,0,0],
        [0,0,0,0,0,0,0,0,0,0],
        [0,0,0,0,0,0,0,0,0,0]
    ],
]

n = int(input())
count = 1
while count <= n:
    b, f, r, v = map(int, input().split())
    mansyon[b-1][f-1][r-1] = v
    count += 1

for tou in range(4):
    for kai in range(3):
        print(' ', end='')
        for heya in range(10):
            print(mansyon[tou][kai][heya], end='')
        print('\n', end='')
    if 0 <= tou <= 2:
        print("####################")

Submission status: WA: Presentation Error

Solution code:
from collections import defaultdict

tower = defaultdict(lambda: defaultdict(list))
for x in range(1, 5):
    for y in range(1, 4):
        for z in range(1, 11):
            tower[x][y].append(0)

count = int(input())

for x in range(count):
    b, f, r, v = map(int, input().split())
    if v > 0:
        tower[b][f][r-1] += v
    else:
        tower[b][f][r-1] -= -v


for key, value in tower.items():
    for layer, value in value.items():
        print(' '.join(map(str, value)))
    if key != 4:
        print('#' * 20)

Submission status: WA: Presentation Error

Solution code:
F = [0 for i in range(10)]
def dfloor(l):
    f = F.copy()
    f[l[0]-1] = l[1]
    return f

H = {1:[F,F,F],
    2:[F,F,F],
    3:[F,F,F],
    4:[F,F,F]}
N = int(input())
p = 0
for n in range(N):
    a,b,c,d = tuple(int(n) for n in input().split())
    H[a][b-1] = [H[a][b-1][h]+dfloor([c,d])[h] for h in range(10)]
for I in H.values():
    p += 1
    for i in I:
        print(" ".join(map(str,i)))
    if p != 4:
        print("#"*20)

Submission status: WA: Presentation Error

Solution code:
roomsOfBuilding = [[[0 for i in range(10)] for j in range(3)] for k in range(4)]

n = int(input())
for l in range(n):
    # b棟f階のr番目の部屋にv人
    b, f, r, v = map(int, input().split())
    roomsOfBuilding[b - 1][f - 1][r - 1] += v
counter = 0
for building in roomsOfBuilding:
    counter += 1
    for rooms in building:
        for room in rooms:
            print(room, end=' ')
        print('')
    if counter < 4:
        print('#' * 20)

Submission status: WA: Presentation Error

Solution code:
roomsOfBuilding = [[[0 for i in range(10)] for j in range(3)] for k in range(4)]

n = int(input())
for l in range(n):
    # b棟f階のr番目の部屋にv人
    b, f, r, v = map(int, input().split())
    roomsOfBuilding[b - 1][f - 1][r - 1] += v
counter = 0
roomCounter = 1
for building in roomsOfBuilding:
    counter += 1
    for rooms in building:
        for room in rooms:
            if roomCounter % 10 == 0:
                print(room, end='')
            else:
                print(room, end=' ')
            roomCounter += 1
        print('')
    if counter < 4:
        print('#' * 20)

Submission status: WA: Presentation Error

Solution code:
home = [[[0 for i in range(10)] for j in range(3)] for k in range(4)]
N = int(input())
for i in range(N):
    a, b, c, d = map(int, input().split())
    home[a - 1][b - 1][c - 1] = d
for i in range(3):
    for j in range(3):
        for k in range(9):
            print(str(home[i][j][k]), end =' ')
        print(str(home[i][j][9]))
    print('####################')
for j in range(3):
    for k in range(9):
        print(str(home[3][j][k]), end =' ')
    print(str(home[3][j][9]))

Submission status: WA: Presentation Error

Solution code:
home = [[[0 for i in range(10)] for j in range(3)] for k in range(4)]
N = int(input())
for i in range(N):
    a, b, c, d = map(int, input().split())
    home[a - 1][b - 1][c - 1] = d
for i in range(3):
    for j in range(3):
        for k in range(9):
            print(str(home[i][j][k]), end =' ')
        print(str(home[i][j][9]) + ' ')
    print('####################')
for j in range(3):
    for k in range(9):
        print(str(home[3][j][k]), end =' ')
    print(str(home[3][j][9]) + ' ')

Submission status: WA: Presentation Error

Solution code:
#! python3
# official_house.py

n = int(input())
rooms = [[int(x) for x in input().split(' ')] for i in range(n)]

for i in range(4):
    if i != 0: print('####################')
    for j in range(3):
        for k in range(10):
            flag = False
            for r in range(n):
                if i+1 == rooms[r][0] and j+1 == rooms[r][1] and k+1 == rooms[r][2]:
                    print(str(rooms[r][3]), end='')
                    flag = True
                    break
            if not flag:
                print('0', end='')
        print('')

Submission status: WA: Presentation Error

Solution code:
#! python3
# official_house.py

n = int(input())
rooms = [[int(x) for x in input().split(' ')] for i in range(n)]

rooms_people = [[[0 for k in range(10)] for j in range(3)] for i in range(4)]
for i in range(n):
    rooms_people[rooms[i][0]-1][rooms[i][1]-1][rooms[i][2]-1] += rooms[i][3]

for i in range(4):
    if i != 0: print('####################')
    for j in range(3):
        for k in range(10):
            print(rooms_people[i][j][k], end='')
        print('')

Submission status: WA: Presentation Error

Solution code:
field = [[0 for i in range(10)]for i in range (15)]
num = int(input())
for i in range (num):
	b,f,r,v = map(int,input().split())
	field[((b-1)*4)+f-1][(r-1)] = v
for i in range(15):
	if( i % 4 == 3 ):
 		field[i] = ['#'*20]
for i in range(15):
	field[i] = map(str,field[i])
for i in range(15):
		if not( i % 4 == 3 ):
			print(' '.join(field[i]))
		else:
			print(''.join(field[i]))

Submission status: WA: Presentation Error

Solution code:
num = [[[0 for i in range(10)] for i in range(3)] for i in range(4)]

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

for b in range(4):
    for f in range(3):
        print(" ".join(map(str, num[b][f])))
    if b < 3:
        print("#"*20)

Submission status: WA: Presentation Error

Solution code:
n=int(input())
ichi=[0,0,0,0,0,0,0,0,0,0,0,0]
ni=[0,0,0,0,0,0,0,0,0,0,0,0]
san=[0,0,0,0,0,0,0,0,0,0,0,0]
yon=[0,0,0,0,0,0,0,0,0,0,0,0]
go=[0,0,0,0,0,0,0,0,0,0,0,0]
roku=[0,0,0,0,0,0,0,0,0,0,0,0]
nana=[0,0,0,0,0,0,0,0,0,0,0,0]
hachi=[0,0,0,0,0,0,0,0,0,0,0,0]
kyu=[0,0,0,0,0,0,0,0,0,0,0,0]
zyu=[0,0,0,0,0,0,0,0,0,0,0,0]
zyu_ichi=[0,0,0,0,0,0,0,0,0,0,0,0]
zyu_ni=[0,0,0,0,0,0,0,0,0,0,0,0]

while n>0:
    l=input().split()
    b=int(l[0])
    f=int(l[1])
    r=int(l[2])
    v=int(l[3])

    num=3*(b-1)+f

    if num==1:
        ichi[r-1]+=v
    elif num==2:
        ni[r-1]+=v
    elif num==3:
        san[r-1]+=v
    elif num==4:
        yon[r-1]+=v
    elif num==5:
        go[r-1]+=v
    elif num==6:
        roku[r-1]+=v
    elif num==7:
        nana[r-1]+=v
    elif num==8:
        hachi[r-1]+=v
    elif num==9:
        kyu[r-1]+=v
    elif num==10:
        zyu[r-1]+=v
    elif num==11:
        zyu_ichi[r-1]+=v
    else:
        zyu_ni[r-1]+=v
    n=n-1
m=1
A=str(ichi[0])
B=str(ni[0])
C=str(san[0])
D=str(yon[0])
E=str(go[0])
F=str(roku[0])
G=str(nana[0])
H=str(hachi[0])
I=str(kyu[0])
J=str(zyu[0])
K=str(zyu_ichi[0])
L=str(zyu_ni[0])
while m<10:
    A=A+" "+str(ichi[m])
    B=B+" "+str(ni[m])
    C=C+" "+str(san[m])
    D=D+" "+str(yon[m])
    E=E+" "+str(go[m])
    F=F+" "+str(roku[m])
    G=G+" "+str(nana[m])
    H=H+" "+str(hachi[m])
    I=I+" "+str(kyu[m])
    J=J+" "+str(zyu[m])
    K=K+" "+str(zyu_ichi[m])
    L=L+" "+str(zyu_ni[m])
    m=m+1
print(A)
print(B)
print(C)
print("####################")
print(D)
print(E)
print(F)
print("####################")
print(G)
print(H)
print(I)
print("####################")
print(J)
print(K)
print(L)

Submission status: WA: Presentation Error

Solution code:
# b棟f階r番目の部屋にv人追加
dom = {
    "1": [
        [0] * 10,
        [0] * 10,
        [0] * 10,
        "#" * 20
    ],
    "2": [
        [0] * 10,
        [0] * 10,
        [0] * 10,
        "#" * 20
    ],
    "3": [
        [0] * 10,
        [0] * 10,
        [0] * 10,
        "#" * 20
    ],
    "4": [
        [0] * 10,
        [0] * 10,
        [0] * 10
    ],
}

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

for i in ["1", "2", "3", "4"]:
    for j in range(len(dom[i])):
        for k in range(len(dom[i][j])):
            print(dom[i][j][k], end="")
        print("")

Submission status: WA: Presentation Error

Solution code:
nums = [[[0 for _ in range(10)] for _ in range(3)] for _ in range(4)]

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

sep = ""
for building in nums:
    print(sep * 20)
    for floor in building:
        for room in floor:
            print(" " + str(room), end = "")
        print()
    sep = "#"

Submission status: WA: Presentation Error

Solution code:
nums = [[[0 for _ in range(10)] for _ in range(3)] for _ in range(4)]

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

sep = ""
for building in nums:
    print(sep * 20)
    for floor in building:
        for room in floor:
            print(" " + str(room), end = "")
        print()
    sep = "#"
print()

Submission status: WA: Presentation Error

Solution code:
N = int(input())
n = [input().split() for _ in range(N)]

all_info = [[["0" for _ in range(10)] for _ in range(3)] for _ in range(4)]

def change_room(info):
    info = [int(i) for i in info]
    info_dic = {"all_info": all_info,
                "buil": info[0]-1,
                "loc" : info[1]-1,
                "room": info[2]-1,
                "num" : str(info[3])}

    exec("all_info[buil][loc][room] = num", info_dic)

for i in n:
    change_room(i)

for num, i in enumerate(all_info):
    for j in i:
        print(" ".join(j))
    if num < N: print("#"*20)

Submission status: WA: Presentation Error

Solution code:
N = int(input())
n = [input().split() for _ in range(N)]

all_info = [[["0" for _ in range(10)] for _ in range(3)] for _ in range(4)]

def change_room(info):
    info = [int(i) for i in info]
    info_dic = {"all_info": all_info,
                "buil": info[0]-1,
                "loc" : info[1]-1,
                "room": info[2]-1,
                "num" : str(info[3])}

    exec("all_info[buil][loc][room] = num", info_dic)

for i in n:
    change_room(i)

for num, i in enumerate(all_info):
    for j in i:
        print(" ".join(j))
    if num < N: 
        print("#"*20)

Submission status: WA: Presentation Error

Solution code:
bfr = [[[0 for _ in range(10)] for _ in range(3)] for _ in range(4)]

n = int(input())
for _ in range(n):
    b, f, r, v = map(int, input().split())
    bfr[b-1][f-1][r-1] += v
for b in range(4):
    for f in range(3):
        print(' '.join(map(str, bfr[b][f])))
    if b != 3:
        print('#'*20)

Submission status: WA: Presentation Error

Solution code:
bfr = [[[0 for _ in range(10)] for _ in range(3)] for _ in range(4)]

n = int(input())
for _ in range(n):
    b, f, r, v = map(int, input().split())
    bfr[b-1][f-1][r-1] += v
for b in range(4):
    for f in range(3):
        print(' '.join(map(str, bfr[b][f])))
    if b != 3:
        print('#'*20)
print()

Submission status: WA: Presentation Error

Solution code:
n=int(input())
S=[]
for i in range(1200):
    S.append(0)

for i in range(n):
    k=input().split()
    b=int(k[0])
    f=int(k[1])
    r=int(k[2])
    v=int(k[3]) 
    S[(b-1)*30+(f-1)*10+r-1]+=v
for i in range(4):
    for j in range(3):
        msg=""
        for t in range(9):
            msg+=str(S[i*30+j*10+t])+" "
        msg+=str(S[i*30+j*10+9])
        print(msg)
    if i<3:
        print("####################")

Submission status: WA: Presentation Error

Solution code:

import sys

c = int(input())

a = []
for line in sys.stdin :
    a.append(line)
    c -= 1
    if c == 0 :
        break

for i in range(0, len(a)) :
    a[i] = a[i].strip().split(" ")
    for j in range(0, len(a[i])) :
        a[i][j] = int(a[i][j])

kousya = [
[
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
],
[
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
],
[
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
],
[
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
]
]

for i in a :
    kousya[i[0]-1][i[1]-1][i[2]-1] += i[3]

touc = 0

for tou in kousya :
    for kai in tou :
        for heya in kai :
            print(heya, end=" ")
        print()
    if touc != len(kousya)-1 :
        print("#"*20)
    touc += 1

Submission status: WA: Presentation Error

Solution code:

import sys

c = int(input())

a = []
for line in sys.stdin :
    a.append(line)
    c -= 1
    if c == 0 :
        break

for i in range(0, len(a)) :
    a[i] = a[i].strip().split(" ")
    for j in range(0, len(a[i])) :
        a[i][j] = int(a[i][j])

kousya = [
[
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
],
[
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
],
[
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
],
[
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
]
]

for i in a :
    kousya[i[0]-1][i[1]-1][i[2]-1] += i[3]

touc = 0
kaic = 0
for tou in kousya :
    for kai in tou :
        for heya in kai :
            if kaic != len(kai)-1 :
                print(heya, end=" ")
            else :
                print(heya, end="")
            kaic += 1
        print()
        kaic = 0
    if touc != len(kousya)-1 :
        print("#"*20)
    touc += 1

Submission status: WA: Presentation Error

Solution code:
def main():
    k = [[[0 for x in range(10)] for x in range(3)] for x in range(4)]
    n = int(input())
    for i in range(n):
        b, f, r, v = map(int, raw_input().split())
        k[b-1][f-1][r-1] += v

    for b in range(4):
        for f in range(3):
            print(" ".join(map(str, k[b][f])))
        if b != 3:
            print("#"*20)

main()

def arr(n):
	return [None]*n

Submission status: WA: Presentation Error

Solution code:
import sys

x = []
i = 0
for line in sys.stdin:
    if i==0:
        lx = int(line)
    else:
        x.append([int(i) for i in line.split()])
    i = 1

rb = range(4)
rf = range(3)
rr = range(10)
rooms = [[[0 for i in rr] for j in rf]for k in rb]
for e in x:
    i,j,k,l = e
    rooms[i-1][j-1][k-1] += l

for i in rb:
    for j in rf:
        for k in rr:
            print rooms[i][j][k],
        print
    if i<len(rb)-1: print '#' * 20

Submission status: WA: Presentation Error

Solution code:
import sys

x = []
i = 0
for line in sys.stdin:
    if i==0:
        lx = int(line)
    else:
        x.append([int(i) for i in line.split()])
    i = 1

rb = range(4)
rf = range(3)
rr = range(10)
rooms = [[[0 for i in rr] for j in rf]for k in rb]
for e in x:
    i,j,k,l = e
    rooms[i-1][j-1][k-1] += l

for i in rb:
    for j in rf:
        print ' ',
        for k in rr:
            print rooms[i][j][k],
        print
    if i<len(rb)-1: print '#' * 20

Submission status: WA: Presentation Error

Solution code:
def perl():
        for i in range(4):
                for j in range(3):
                        for k in range (10):
                                print l[i][j][k],
                        print
                if i != 3:
                        print "####################"

n=int(raw_input())
l=[[[0 for k in range(10)]for j in range(3)]for i in range
(4)]
for N in range(n):
        e=map(int,raw_input().split())
        b=e[0]-1
        f=e[1]-1
        r=e[2]-1
        l[b][f][r]+=e[3]
perl()

Submission status: WA: Presentation Error

Solution code:
def perl():
        for i in range(4):
                for j in range(3):
                        for k in range (10):
                                print l[i][j][k],
                        print
                if i != 3:
                        print "####################"

n=int(raw_input())
l=[[[0 for k in range(10)]for j in range(3)]for i in range(4)]
for N in range(n):
        e=map(int,raw_input().split())
        b=e[0]-1
        f=e[1]-1
        r=e[2]-1
        l[b][f][r]+=e[3]
perl()

Submission status: WA: Presentation Error

Solution code:
#!/usr/bin/env python
# -*- coding:utf-8 -*-
#from __future__ import print_function

A=[[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0]]
B=[[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0]]
C=[[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0]]
D=[[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0]]
l=[]
N=int(raw_input())
for i in range(N):
    (b,f,r,v)=map(int, raw_input().split())
    if b==1: A[f-1][r-1]+=v
    elif b==2: B[f-1][r-1]+=v
    elif b==3: C[f-1][r-1]+=v
    elif b==4: D[f-1][r-1]+=v

for j in A:
    print ' '.join(map(str, j))
print '#'*20 
for k in B:
    print ' '.join(map(str, k))
print '#'*20 
for l in C:
    print ' '.join(map(str, l))
print '#'*20 
for m in D:
    print ' '.join(map(str, m))

Submission status: WA: Presentation Error

Solution code:
a = [] 
for i in xrange(0,4):
    b = []
    for j in xrange(0,3):
        b.append([0]*10)
    a.append(b)
n = int(raw_input())
for i in xrange(0,n):
    b,f,r,v = map(int,raw_input().split())
    a[b-1][f-1][r-1] += v
for i,arr in enumerate(a):
    for j in arr:
        print " ".join(map(str,j))
    if i != len(a)-1:
        print "#"*20

Submission status: WA: Presentation Error

Solution code:
rooms = [[[0 for i in range(10)] for j in range(3)] for h in range(4)]
n = input()
for i in range(n):
	b, f, r, v = map(int, raw_input().split())
	rooms[b-1][f-1][r-1] = rooms[b-1][f-1][r-1] + v

for i in range(len(rooms)):
	for j in rooms[i]:
		print " ".join(map(str, j))
	if i != 3: print "#" * 20