Buggy python submission (verdict: Runtime Error):
import sys
import numpy as np

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

rooms = np.zeros((4,3,10), dtype = int)
for e in x:
    i,j,k,l = e
    rooms[i-1][j-1][k-1] += l

for i in range(4):
    for j in range(3):
        for k in range(10):
            print rooms[i][j][k],
        print
    if i<3: print '#' * 20

Fixed submission:
rb = range(4)
rf = range(3)
rr = range(10)
rooms = [[[0 for i in rr] for j in rf]for k in rb]

lx = int(raw_input())
for i in range(lx):
    b,f,r,v = map(int, raw_input().split())
    rooms[b-1][f-1][r-1] += v

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

Buggy python submission (verdict: Runtime Error):
import sys

x = []
i = 0
for line in open('in1.txt','r'):#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

Fixed submission:
rb = range(4)
rf = range(3)
rr = range(10)
rooms = [[[0 for i in rr] for j in rf]for k in rb]

lx = int(raw_input())
for i in range(lx):
    b,f,r,v = map(int, raw_input().split())
    rooms[b-1][f-1][r-1] += v

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

Buggy python submission (verdict: Runtime Error):
rb = range(4)
rf = range(3)
rr = range(10)
rooms = [[[0 for i in rr] for j in rf]for k in rb]
while True:
    lx = int(raw_input())
    for i in range(lx):
        b,f,r,b = map(int, raw_input().split())
        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

Fixed submission:
rb = range(4)
rf = range(3)
rr = range(10)
rooms = [[[0 for i in rr] for j in rf]for k in rb]

lx = int(raw_input())
for i in range(lx):
    b,f,r,v = map(int, raw_input().split())
    rooms[b-1][f-1][r-1] += v

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

Buggy python submission (verdict: Runtime Error):
rb = range(4)
rf = range(3)
rr = range(10)
rooms = [[[0 for i in rr] for j in rf]for k in rb]
while True:
    lx = int(raw_input())
    for i in range(lx):
        b,f,r,v = map(int, raw_input().split())
        rooms[b-1][f-1][r-1] += v

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

Fixed submission:
rb = range(4)
rf = range(3)
rr = range(10)
rooms = [[[0 for i in rr] for j in rf]for k in rb]

lx = int(raw_input())
for i in range(lx):
    b,f,r,v = map(int, raw_input().split())
    rooms[b-1][f-1][r-1] += v

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