qyliang/CodeNanoFix huggingface dataset:
Buggy code:
a = [[[0 for r in range(10)] for f in range(3)] for b in range(4)]
print(a)
n = int(input())
for i in range(n):
    b, f, r, v = map(int, input().strip().split())
    a[b - 1][f - 1][r - 1] += v
for b in range(4):
    for f in range(3):
        print(''.join(' {}'.format(a[b][f][r]) for r in range(10)))
    if b < 3:
        print('#'*20)

Fixed code:
n = int(input())
a = [[[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 = map(int,input().split())
    a[b-1][f-1][r-1] += v

for b in range(4):
    for f in range(3):
        print(''.join(' {}'.format(a[b][f][r]) for r in range(10)))
    if b<3:
        print('#'*20)
Buggy code:
arr = [[[0 for i in range(10)] for j in range(3)] for k in range(4)]
for i in range(int(input())):
    b,f,r,v = map(int, input().split())
    arr[b-1][f-1][r-1] += v
for i in range(4):
    for j in range(3):
        for k in range(10):
            if k == 9:
                print(arr[i][j][k])
            else:
                print(arr[i][j][k], end=" ")
    if i != 3:
        print("#"*20)

Fixed code:
arr = [[[0 for i in range(10)] for j in range(3)] for k in range(4)]
for i in range(int(input())):
    b,f,r,v = map(int, input().split())
    arr[b-1][f-1][r-1] += v
for i in range(4):
    for j in range(3):
        for k in range(10):
            if k == 0:
                print ("", end=" ")
            if k == 9:
                print(arr[i][j][k])
            else:
                print(arr[i][j][k], end=" ")
    if i != 3:
        print("#"*20)
Buggy code:
house = [[[0]*10 for i in range(3)] for j in range(4)]

n = int(input())
for i in range(n):
    data = list(map(int, input().split()))
    house[data[0]-1][data[1]-1][data[2]-1] = data[3]
    
for i in range(4):
    for j in range(3):
        print('',' '.join(list(map(str,house[i][j]))))
    print('####################')

Fixed code:
house = [[[0]*10 for i in range(3)] for j in range(4)]

n = int(input())
for i in range(n):
    data = list(map(int, input().split()))
    house[data[0]-1][data[1]-1][data[2]-1] += data[3]
    
for i in range(4):
    for j in range(3):
        print('',' '.join(list(map(str,house[i][j]))))
    if i!=3: print('####################')
Buggy code:
data = [[[0 for r in range(10)] for f in range(3)] for b in range(4)]


n = int(input())

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

for b in range(4):
    for f in range(3):
        for r in range(10):
            print('',data[b][f][r], end = '')
        print()
        if b < 3:
            print('#' * 20)

Fixed code:

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

n = int(input())

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

for b in range(4):
    for f in range(3):
        for r in range(10):
            print('',data[b][f][r], end='')
        print()
    if b < 3:
        print('#' * 20)
Buggy code:
a = [[[0 for z in range(10)] for y in range(3)] for x in range(4)]
n = int(input())
for i in range(n):
    b, f, r, v = [int(x) for x in input().split()]
    a[b - 1][f - 1][r - 1] += v

for i in range(4):
    for j in range(3):
        print(*a[i][j])
    if i != 3:
        print('#' * 20)

Fixed code:
a = [[[0 for z in range(10)] for y in range(3)] for x in range(4)]
n = int(input())
for i in range(n):
    b, f, r, v = [int(x) for x in input().split()]
    a[b - 1][f - 1][r - 1] += v

for i in range(4):
    for j in range(3):
        print('', *a[i][j])
    if i != 3:
        print('#' * 20)
Buggy code:
buils = [
    [
        [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
        [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
        [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]],
    [
        [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
        [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
        [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]],
    [
        [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
        [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
        [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]],
    [
        [0, 0, 0, 0, 0, 0, 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())

for i in range(n):
    BFRV = input().split()
    b = int(BFRV[0])
    f = int(BFRV[1])
    r = int(BFRV[2])
    v = int(BFRV[3])
    
    buils[b-1][f-1][r-1] = buils[b-1][f-1][r-1] + v

for b in range(4):
    for f in range(3):
        for r in range(10):
            print(" ",end="" )
            print(buils[b][f][r], end="")
        print("")
    print("####################")

Fixed code:
buils = [
    [
        [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
        [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
        [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]],
    [
        [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
        [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
        [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]],
    [
        [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
        [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
        [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]],
    [
        [0, 0, 0, 0, 0, 0, 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())

for i in range(n):
    BFRV = input().split()
    b = int(BFRV[0])
    f = int(BFRV[1])
    r = int(BFRV[2])
    v = int(BFRV[3])
    
    buils[b-1][f-1][r-1] = buils[b-1][f-1][r-1] + v

for b in range(4):
    for f in range(3):
        for r in range(10):
            print(" ", end="")
            print(buils[b][f][r], end="")
        print("")
    if b != 3:
        print("####################")
Buggy code:
n=int(input())
data=[[int(num)for num in input().split(' ')] for i in range(n)]
state=[[[0 for i in range(10)]for j in range(3)]for k in range(4)] 
for datum in data:
    state[datum[0]-1][datum[1]-1][datum[2]-1]+=datum[3]
for i in range(4):
    for j in range(3):
        s=""
        for k in range(10):
            s+=str(state[i][j][k])
        print(s)
    if i!=3:
        print('####################')

Fixed code:
n=int(input())
data=[[int(num)for num in input().split(' ')] for i in range(n)]
state=[[[0 for i in range(10)]for j in range(3)]for k in range(4)] 
for datum in data:
    state[datum[0]-1][datum[1]-1][datum[2]-1]+=datum[3]
for i in range(4):
    for j in range(3):
        s=""
        for k in range(10):
            s+=' '+str(state[i][j][k])
        print(s)
    if i!=3:
        print("####################")
Buggy code:
N = int(input())
buildings = [[[0]*10]*3]*4
for i in range(N):
 b, f, r, num = map(int, input().split())
 buildings[b-1][f-1][r-1] += num

for i in range(4):
 for j in range(3):
  for k in range(10):
   print(" {0}".format(buildings[i][j][k]), end="")
  print()
 if i!=3:
  print("####################")

Fixed code:
N = int(input())
buildings = [[[0 for V in range(10)] for F in range(3)] for B in range(4)]
for i in range(N):
 b, f, r, num = map(int, input().split())
 buildings[b-1][f-1][r-1] += num

for i in range(4):
 for j in range(3):
  for k in range(10):
   print(" {0}".format(buildings[i][j][k]), end="")
  print()
 if i!=3:
  print("####################")
Buggy code:
n=int(input())
a=[[[0 for _ in range(10)]for _ in range(3)]for _ in range(4)]
for i in range(n):
    b,f,r,v=map(int, input().split())
    a[b-1][f-1][r-1]+=v
for bb in range(b):
    for ff in range(f):
        print(*[""]+a[bb][ff])
    if bb==2:
        break
    else:
        print("#"*20)


Fixed code:
n=int(input())
a=[[[0 for _ in range(10)]for _ in range(3)]for _ in range(4)]
for i in range(n):
    b,f,r,v=map(int, input().split())
    a[b-1][f-1][r-1]+=v
for bb in range(4):
    for ff in range(3):
        print(*[""]+a[bb][ff])
    if bb==3:
        break
    else:
        print("#"*20)
Buggy code:
n = int(input())
count = 0
room = [int(0) for i in range(4) for j in range(3) for k in range(10)]
while count < n:
    x = list(map(lambda k: int(k), input().split(" ")))
    room[(x[0]-1)*30+(x[1]-1)*10+(x[2]-1)] += x[3]
    count += 1
for i in range(4):
    if i != 0:
        print("####################")
    for j in range(3):
        for k in range(10):
            if k == 0:
                print("%d" % room[30*i+10*j+k], end="")
            else:
                print(" %d" % room[30*i+10*j+k], end="")
        print("")

Fixed code:
n = int(input())
count = 0
room = [int(0) for i in range(4) for j in range(3) for k in range(10)]
while count < n:
    x = list(map(lambda k: int(k), input().split(" ")))
    room[(x[0]-1)*30+(x[1]-1)*10+(x[2]-1)] += x[3]
    count += 1
for i in range(4):
    if i != 0:
        print("####################")
    for j in range(3):
        for k in range(10):
            print(" %d" % room[30*i+10*j+k], end="")
        print("")
Buggy code:
data = [
        [[0 for k in range(10)] for j in range(3)] for i in range(4)
        ]

count = int(input())

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

for b in range(4):
    for f in range(3):
        print(' ',end='')
        for r in range(10):
                print(data[b][f][r], '', end='')
        print()

    if b == 3:
        break
    for x in range(20):
        print('#',end='')
    print()

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

count = int(input())

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

for b in range(4):
    for f in range(3):
        print(' ',end='')
        for r in range(10):
            if r == 9:
                print(data[b][f][r], end='')
            else:
                print(data[b][f][r], '', end='')
        print()

    if b == 3:
        break
    for x in range(20):
        print('#',end='')
    print()
Buggy code:
import sys

a=[]
for t in range(4):
    a.append([])
    for f in range(3):
        a[t].append([])
        for r in range(10):
            a[t][f].append(0)

lines = [line for line in sys.stdin]

n = lines[0]

for l in lines[1:]:
    b, f, r, v  = map(int,l.split())
    b -= 1
    f -= 1
    r -= 1
    a[b][f][r] += v

for i,t in enumerate(a):
    for f in t:
        print (" ".join(map(str,f)))
    if len(a) != i +1:
        print ('#'*20)

Fixed code:
import sys

a=[]
for t in range(4):
    a.append([])
    for f in range(3):
        a[t].append([])
        for r in range(10):
            a[t][f].append(0)

lines = [line for line in sys.stdin]

n = lines[0]

for l in lines[1:]:
    b, f, r, v  = map(int,l.split())
    b -= 1
    f -= 1
    r -= 1
    a[b][f][r] += v

for i,t in enumerate(a):
    for f in t:
        print (" " +" ".join(map(str,f)))
    if len(a) != i +1:
        print ('#'*20)
Buggy code:
N = int(input())
residents = [[["0" for rooms in range(10)]for floor in range(3)]for builds in range(4)]

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

for buils_num in range(4):
    for floor_num in range(3):
        print(' '.join(residents[buils_num][floor_num]))
    if buils_num < 3:
        print('#'*20)

Fixed code:
N = int(input())
residents = [[["0" for rooms in range(10)]for floor in range(3)]for builds in range(4)]

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

for buils_num in range(4):
    for floor_num in range(3):
        print(' '+' '.join(residents[buils_num][floor_num]))
    if buils_num < 3:
        print('#'*20)
Buggy code:
n = int(input())
apart = [[[0 for i in range(10)] for j in range(3)] for k in range(4)]
for joho in range(n):
    x = [int(i) for i in input().split()]
    apart[x[2]][x[1]][x[0]] += x[3]

for tou in range(4):
    for stair in range(3):
        for room in range(10):
            print(" ",apart[tou][stair][room],sep="",end="")
        print("")
    if tou != 3:
        print("####################")



Fixed code:
n = int(input())
apart = [[[0 for i in range(10)] for j in range(3)] for k in range(4)]
for joho in range(n):
    x = [int(i) for i in input().split()]
    apart[x[0]-1][x[1]-1][x[2]-1] += x[3]

for tou in range(4):
    for stair in range(3):
        for room in range(10):
            print(" ",apart[tou][stair][room],sep="",end="")
        print("")
    if tou != 3:
        print("####################")
Buggy code:
a = [[[0 for i in range(10)] for j in range(3)] for k in range(4)]
n = int(input())

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

for k in range(4):
	for j in range(3):
		for i in range(10):
			print(" {}".format(a[k][j][i]), end="")
		print("")
	print("#" * 20)
print("")

Fixed code:
L = [[[ 0 for i in range(10)] for j in range(3)] for k in range(4)]
n = int(input())
for i in range(n):
         b,f,r,v = map(int,input().split())
         L[b-1][f-1][r-1] += v
for i in range(4):
         for j in range(3):
                  for k in range(10):
                           print(" {}".format(L[i][j][k]), end = "")
                  print()
         if i + 1 != 4:
                  print("#" * 20)
Buggy code:
n = int(input())
count = list()
for b in range(4):
    count.append(list())
    for f in range(3):
        count[b].append(list())
        for r in range(10):
            count[b][f].append(0)
            # count[b][f][r] = 0

read = 0
while read < n:
    b,f,r,v = [int(x) for x in input().split(" ")]
    count[b-1][f-1][r-1] = v
    read += 1

for b in range(4):
    for f in range(3):
        for r in range(10):
            print("", count[b][f][r], end="")
        print()
    print("####################")
    

Fixed code:
n = int(input())
count = list()
for b in range(4):
    count.append(list())
    for f in range(3):
        count[b].append(list())
        for r in range(10):
            count[b][f].append(0)

read = 0
while read < n:
    b,f,r,v = [int(x) for x in input().split(" ")]
    count[b-1][f-1][r-1] += v
    read += 1

for b in range(len(count)):
    for f in range(len(count[b])):
        for r in range(len(count[b][f])):
            print("", count[b][f][r], end="")
        print()
    if b < len(count) - 1:
        print("####################")
Buggy code:
# coding:utf-8

class FLOOR:
    def __init__(self):
        self.room = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]

class BUILD:
    def __init__(self):
        self.floor = [FLOOR(), FLOOR(), FLOOR()]

# 3??????10??¨?±????4?£?
all_rooms = [BUILD(), BUILD(), BUILD(), BUILD()]

# ??\???
n = int(input())
for i in range(n):
    b, f, r, v = map(int, input().split())
    all_rooms[b-1].floor[f-1].room[r-1] += v

for b in range(4):
    for f in range(3):
        display = []
        for r in range(10):
            display.append(str(all_rooms[b].floor[f].room[r]))
        print(' '.join(display))
    if (b < 3):
        print('#'*20)

Fixed code:
# coding:utf-8

class FLOOR:
    def __init__(self):
        self.room = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]

class BUILD:
    def __init__(self):
        self.floor = [FLOOR(), FLOOR(), FLOOR()]

# 3??????10??¨?±????4?£?
all_rooms = [BUILD(), BUILD(), BUILD(), BUILD()]

# ??\???
n = int(input())
for i in range(n):
    b, f, r, v = map(int, input().split())
    all_rooms[b-1].floor[f-1].room[r-1] += v

for b in range(4):
    for f in range(3):
        display = []
        for r in range(10):
            display.append(str(all_rooms[b].floor[f].room[r]))
        print(' ' + ' '.join(display))
    if (b < 3):
        print('#'*20)
Buggy code:
n = int(input())
house = []
for i in range(4):
    house.append([])
    for j in range(3):
        house[i].append([])
        for k in range(10):
            house[i][j].append(0)

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


for i in range(4):
    for j in range(3):
        for k in range(10):
            print("" , house[i][j][k], end="")
        print()
    if b < 3:
        print("#" * 20)

Fixed code:
n = int(input())
house = []
for i in range(4):
    house.append([])
    for j in range(3):
        house[i].append([])
        for k in range(10):
            house[i][j].append(0)

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


for i in range(4):
    for j in range(3):
        for k in range(10):
            print("" , house[i][j][k], end="")
        print()
    if i < 3:
        print("#" * 20)
Buggy code:
a=[[[0]*10]*3]*4
for _ in range(int(input())):
 b,f,r,v=map(int,input().split())
 a[b-1][f-1][r-1]+=v
for i in range(4):
 for j in range(3):
  print(' '.join(a[i][j]))
 if i!=3:print('#'*20)

Fixed code:
a=[[10*[0]for _ in[0]*3]for _ in[0]*4]
for _ in[0]*int(input()):
 b,f,r,v=map(int,input().split())
 a[b-1][f-1][r-1]+=v
for i in range(4):
 for j in range(3):print('',*a[i][j])
 if i<3:print('#'*20)
Buggy code:
date = [[[0 for r in range(10)] for f in range(3)] for b in range(4)]
n = int(input())
for _ in range(n):
    (b,f,r,v) = [int(i) for i in input().split()]
    data[b - 1][f - 1][r - 1] += v

for b in range(4):
    for f in range(3):
        for r in range(10):
            print('',data[b][f][r], end='')
        print()
    if b < 3:
        print('#' * 20)

Fixed code:
data = [[[0 for r in range(10)] for f in range(3)] for b in range(4)]
n = int(input())
for _ in range(n):
    (b,f,r,v) = [int(i) for i in input().split()]
    data[b - 1][f - 1][r - 1] += v

for b in range(4):
    for f in range(3):
        for r in range(10):
            print('',data[b][f][r], end='')
        print()
    if b < 3:
        print('#' * 20)
Buggy code:
ryou = [0]*4
for i in range(4):
    ryou[i] = [0]*3
for i in range(4):
    for j in range(3):
        ryou[i][j] = [0]*10
sep = '#' * 20

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

for i in range(4):
    for j in range(3):
        s = ' '.join(map(str,ryou[i][j]))
        print(s)
    if not i == 3:
        print(sep)

Fixed code:
ryou = [0]*4
for i in range(4):
    ryou[i] = [0]*3
for i in range(4):
    for j in range(3):
        ryou[i][j] = [0]*10
sep = '#' * 20

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

for i in range(4):
    for j in range(3):
        s = ' '
        s += ' '.join(map(str,ryou[i][j]))
        print(s)
    if not i == 3:
        print(sep)
Buggy code:
def create_List():
	re_list = [[],[],[],[]]
	for i in range(4):
		for j in range(3):
			re_list[i].append([0 for k in range(10)])
	return re_list

# ????????§??¨?????????????????§????????¨????????????(??????)
num = create_List()
for _ in range(int(input())):
	data = list(map(int,input().split()))
	num[data[0]-1][data[1]-1][data[2]-1] += data[3]

# ????????????
for i in range(4):
	for j in range(3):
		print(' ' + ' '.join(map(str,num[i][j])))
	if i == 4:
		break
	print('#'*20)

Fixed code:
def create_List():
	re_list = [[],[],[],[]]
	for i in range(4):
		for j in range(3):
			re_list[i].append([0 for k in range(10)])
	return re_list

# ????????§??¨?????????????????§????????¨????????????(??????)
num = create_List()
for _ in range(int(input())):
	data = list(map(int,input().split()))
	num[data[0]-1][data[1]-1][data[2]-1] += data[3]

# ????????????
for i in range(4):
	for j in range(3):
		print(' ' + ' '.join(map(str,num[i][j])))
	if i == 3:
		break
	print('#'*20)
Buggy code:
D = [[[0 for V in range(10)] for F in range(3)] for B in range(4)]

n = int(input())

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

for X in D:
    for Y in X:
        print(' ' + ' '.join(map(str,Y)))
    if X != 3:
        print('#'*20)

Fixed code:
D = [[[0 for V in range(10)] for F in range(3)] for B in range(4)]

n = int(input())

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

for B in D[:-1]:
    for F in B:
        print(' ' + ' '.join(map(str,F)))
    print('#'*20)
for F in D[-1]:
    print(' ' + ' '.join(map(str,F)))
Buggy code:
building = [[[0 for i in range(10)] for j in range(3)] for k in range(4)]
n = int(input())

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



for i, b in enumerate(building):
    for f in b:
        for r in f[:-1]:
            print("%d "%(r), end="")
        print("%d"%(f[-1]))
    if i != 3:
        print ("###################")

Fixed code:
building = [[[0 for i in range(10)] for j in range(3)] for k in range(4)]
n = int(input())

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



for i, b in enumerate(building):
    for f in b:
        for r in f:
            print(" %d"%(r), end="")
        print("")
    if i != 3:
        print ("#" * 20)
Buggy code:
n = int(input())
cnt = [[[0 for _ in range(10)] for _ in range(3)] for _ in range(4)]

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

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

  if i != 3:
    print('#'*20)

Fixed code:
n = int(input())
cnt = [[[0 for _ in range(10)] for _ in range(3)] for _ in range(4)]

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

for i in range(4):
  for j in range(3):
    print(' '+' '.join(map(str, cnt[i][j])))

  if i != 3:
    print('#'*20)
Buggy code:
import sys
write=sys.stdout.write

buildings=[[[],[],[]],[[],[],[]],[[],[],[]],[[],[],[]]]
for i in range(0,4):
    for j in range(0,3):
        for k in range(0,10):
            buildings[i][j].append(0)

informations=int(input())

for i in range(0,informations):
    information=[]
    information=input().split()
    information[0]=int(information[0])
    information[1]=int(information[1])
    information[2]=int(information[2])
    information[3]=int(information[3])
    buildings[information[0]-1][information[1]-1][information[2]-1]+=information[3]

for i in range(0,4):
    for j in range(0,3):
        for k in range(0,10):
            write(str(buildings[i][j][k]))
            write(' ')
        print()
    if i !=3:
        for j in range(0,20):
            write('#')
        print()

Fixed code:
import sys
write=sys.stdout.write

buildings=[[[],[],[]],[[],[],[]],[[],[],[]],[[],[],[]]]
for i in range(0,4):
    for j in range(0,3):
        for k in range(0,10):
            buildings[i][j].append(0)

informations=int(input())

for i in range(0,informations):
    information=[]
    information=input().split()
    information[0]=int(information[0])
    information[1]=int(information[1])
    information[2]=int(information[2])
    information[3]=int(information[3])
    buildings[information[0]-1][information[1]-1][information[2]-1]+=information[3]

for i in range(0,4):
    for j in range(0,3):
        for k in range(0,10):
            write(' ')
            write(str(buildings[i][j][k]))
        print()
    if i !=3:
        for j in range(0,20):
            write('#')
        print()
Buggy code:
# ITP1_6_C
# Array - Official House
# http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ITP1_6_C&lang=jp
from sys import stdin

n = int(stdin.readline().rstrip())

NUMBER_OF_BUILDING = 4
FLOORS_PER_BUILDING = 3
ROOMS_PER_FLOOR = 10

official_house = [
    [
        [
            0 for _ in range(ROOMS_PER_FLOOR)
        ] for _ in range(FLOORS_PER_BUILDING)
    ] for _ in range(NUMBER_OF_BUILDING)
]

for cnt in range(n):
    b, f, r, v = (int(n) for n in stdin.readline().rstrip().split())
    official_house[b-1][f-1][r-1] += v

for no, building in enumerate(official_house):
    if no != 0:
        print("#"*20)

    for floor in building:
        print(" ".join(map(str, floor)))


Fixed code:
# ITP1_6_C
# Array - Official House
# http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ITP1_6_C&lang=jp
from sys import stdin

n = int(stdin.readline().rstrip())

NUMBER_OF_BUILDING = 4
FLOORS_PER_BUILDING = 3
ROOMS_PER_FLOOR = 10

official_house = [
    [
        [
            0 for _ in range(ROOMS_PER_FLOOR)
            ] for _ in range(FLOORS_PER_BUILDING)
        ] for _ in range(NUMBER_OF_BUILDING)
    ]

for cnt in range(n):
    b, f, r, v = (int(n) for n in stdin.readline().rstrip().split())
    official_house[b - 1][f - 1][r - 1] += v

for no, building in enumerate(official_house):
    if no != 0:
        print("#" * 20)

    for floor in building:
        print(" " + " ".join(map(str, floor)))