qyliang/CodeNanoFix huggingface dataset:
Buggy code:
date= [
    [[0 for r in range(10)] for f in range(3)] for b in range(4)
    ]

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

for bi, b in enumerate(data):
    for f in b:
        for r in f:
            print(' {0}'.format(r), end='')

        print()
    if bi < 3:
        print('#' * 20)

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

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

for bi, b in enumerate(data):
    for f in b:
        for r in f:
            print(' {0}'.format(r), end='')

        print()
    if bi < 3:
        print('#' * 20)
Buggy code:
data = [[[0 for r 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 = [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 i 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:
N = int(input())
arr = [[[0 for i in range(10)] for j in range(3)]for r in range(4)]
for i in range(N):
    a=[]
    a.append(list(map(int,input().split())))
    b=a[0][0]-1
    f=a[0][1]-1
    r=a[0][2]-1
    v=a[0][3]
    arr[b][f][r]+=v

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

Fixed code:
N = int(input())
arr = [[[0 for i in range(10)] for j in range(3)]for r in range(4)]
for i in range(N):
    a=[]
    a.append(list(map(int,input().split())))
    b=a[0][0]-1
    f=a[0][1]-1
    r=a[0][2]-1
    v=a[0][3]
    arr[b][f][r]+=v

for i in range(0,3):
    for j in range(0,3):
        print(" "+" ".join(map(str,arr[i][j])))
    print("#"*20)
for i in range(3):
    print(" "+" ".join(map(str,arr[3][i])))
Buggy code:
n=int(input())
tou=[[[0 for i in range(10)] for j in range(3)] for k in range(4)]
for _ in range(n):
    b,f,r,v=map(int, input().split())
    tou[b-1][f-1][r-1]+=v

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



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

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



Fixed 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(10):
            print(' ' + str(home[i][j][k]), end ='')
        print()
    print('####################')
for j in range(3):
    for k in range(10):
        print(' ' + str(home[3][j][k]), end ='')
    print()
Buggy 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)


Fixed 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" : 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:
        j = [str(i) for i in j]
        print(" " + (" ".join(j)))
    if num < 3: 
        print("#"*20)
Buggy code:
l = [[[0] * 10 for _ in range(3)] for _ in range(4)]
for _ in range(int(input())):
    b, f, r, v = map(int, input().split())
    l[b - 1][f - 1][r - 1] += v

for x in range(4):
    for y in range(3):
        print()
        print(*l[x][y])
    if x != 3:
        print("####################")

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

for x in range(4):
    for y in range(3):
        print("", *l[x][y])
    if x != 3:
        print("#" * 20)
Buggy code:
n = int(input())
room_list = [[[str(0) for i in range(10)] for j in range(3)] for k in range(4)]
for i in range(n):
    b, f, r, v = map(int, input().split())
    room_list[b - 1][f - 1][r - 1] = str(v)
    
for i in range(4):
    for j in range(3):
        print(" ".join(room_list[i][j]))
    if i < 3:
        print("#" * 20)

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

output =[]
for i in range(4):
    for j in range(3):
        output = list(map(str, room_list[i][j]))
        print(" " + " ".join(output))
    if i < 3:
        print("#" * 20)
Buggy code:
import sys
n = int(input())
list_room = [0 for i in range(120)]

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

#print(list_room)

for i in range(4):
	for j in range(3):
		line = ""
		for k in range(10):
			line += " "+str(list_room[i*30 + j*10 + k])			
		print(line)
		
	print("#"*20)

	

Fixed code:
import sys
n = int(input())
list_room = [0 for i in range(120)]

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

#print(list_room)

for i in range(4):
	for j in range(3):
		line = ""
		for k in range(10):
			line += " "+str(list_room[i*30 + j*10 + k])			
		print(line)
	if i != 3:	
		print("#"*20)
Buggy code:
l = [[[0] * 10 for _ in range(3)] for _ in range(4)]
for _ in range(int(input())):
	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):
		print(*l[i][j], end = " ")
	if i != 3:
		print("####################")

Fixed code:
l = [[[0] * 10 for _ in range(3)] for _ in range(4)]
for _ in range(int(input())):
    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):
        print(end = " ")
        print(*l[i][j])
    if i != 3:
        print("####################")
Buggy code:
room = [0 for i in range(120)]
c = int(input())
for i in range(c):
    b, f, r, v = [int(s) for s in input().split()]
    index = (30 * (b - 1)) + (10 * (f - 1)) + (r - 1)
    room[index] += v

for i in range(12):
    if (i != 0) and (i % 3 == 0):
        print('#' * 20)
    print(' '.join([str(v) for v in room[i*10:i*10+10]]))

Fixed code:
room = [0 for i in range(120)]
c = int(input())
for i in range(c):
    b, f, r, v = [int(s) for s in input().split()]
    index = (30 * (b - 1)) + (10 * (f - 1)) + (r - 1)
    room[index] += v

for i in range(12):
    if (i != 0) and (i % 3 == 0):
        print('#' * 20)
    print(' ' + ' '.join([str(v) for v in room[i*10:i*10+10]]))
Buggy code:
n = int(input())

tenant = [
    [ [0]*10, [0]*10, [0]*10, ],
    [ [0]*10, [0]*10, [0]*10, ],
    [ [0]*10, [0]*10, [0]*10, ],
    [ [0]*10, [0]*10, [0]*10, ]
]


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

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

Fixed code:
n = int(input())

tenant = [
    [ [0]*10, [0]*10, [0]*10, ],
    [ [0]*10, [0]*10, [0]*10, ],
    [ [0]*10, [0]*10, [0]*10, ],
    [ [0]*10, [0]*10, [0]*10, ]
]


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

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


Fixed code:
n= int(input())
tbl=[[[0]*10 for i in range(0,3)] for j in range(0,4)]
for k in range(n):
    b,f,r,v = map(int,input().split())
    tbl[b-1][f-1][r-1] +=v
x=0
for i in range (4):
    if x !=0 : print("#"*20)
    x +=1
    for a in range(3):
        for b in range(10):
            print(" %d"%(tbl[i][a][b]),end="")     
        print()
Buggy code:
l = [[[0 for z in range(10)] for y in range(3)] for x in range(4)]
n = int(input())
while n > 0:
  b,f,r,v = map(int,input().split())
  l[b-1][f-1][r-1] += v
  n -= 1
for b in l:
  for f in b:
    r_l = [str(r) for r in f]
    print(' '+' '.join(r_l))
  print('#'*20)

Fixed code:
l = [[[0 for z in range(10)] for y in range(3)] for x in range(4)]
n = int(input())
while n > 0:
  b,f,r,v = map(int,input().split())
  l[b-1][f-1][r-1] += v
  n -= 1
c = 0
for b in l:
  c += 1
  for f in b:
    r_l = [str(r) for r in f]
    print(' '+' '.join(r_l))
  if c < len(l):  
    print('#'*20)
Buggy code:
bldgs = []
for k in range(4):
    bldgs.append([[0 for i in range(10)] for j in range(3)])

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

for i, bldg in enumerate(bldgs):
    if i > 0:
        print('#'*20)

    for floor in bldg:
        print(' '.join([str(f) for f in floor]))

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

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

for i, bldg in enumerate(bldgs):
    if i > 0:
        print('#'*20)

    for floor in bldg:
        print(' '+' '.join([str(f) for f in floor]))
Buggy code:
resident = [[[0] * 10 for _ in range(3)] for _ in range(4)]
for _ in range(int(input())):
    b, f, r, v = map(int, input().split())
    resident[b - 1][f - 1][r - 1] += v
for b in range(4):
    for f in range(3):
        print(" ".join(map(str, resident[b][f])))
    if b < 3:
        print("####################")



Fixed code:
resident = [[[0] * 10 for _ in range(3)] for _ in range(4)]
for _ in range(int(input())):
    b, f, r, v = map(int, input().split())
    resident[b - 1][f - 1][r - 1] += v
for b in range(4):
    for f in range(3):
        print(" " + " ".join(map(str, resident[b][f])))
    if b < 3:
        print("####################")
Buggy code:
data = [
    [[0 for r in range(10)]for f in range(3)] for b in range(4)
]


count = int(input())
for c 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 enumerate(data):
    for f in b:
        for r in f:
            print(' {0}'.format(r), end='')

        print()

    if bi < 3:
    ??????print('#'* 20)

Fixed code:
data = [
    [[0 for r in range(10)] for f in range(3)] for b in range(4)
]
 
count =int(input())
for c in range(count):
    b, f, r, v = [int(i) for i in input().split()]
    data[b-1][f-1][r-1] += v
 
for bi, b in enumerate(data):
    for f in b:
        for r in f:
            print(' {0}'.format(r), end='')
 
        print()
    if bi < 3:
        print('#' * 20)
Buggy code:
n=int(input())
nyukyo=[list(map(int, input().split())) for i in range(n)]
bld=[[[0 for i in range(10)] for j in range(3)] for k in range(4)]

for ny in nyukyo:
    bld[ny[0]-1][ny[1]-1][ny[2]-1]+=ny[3]

for i,b in enumerate(bld):
    for f in b:
        print(*f)
    if i != 3:
        print("####################")

Fixed code:
n=int(input())
nyukyo=[list(map(int, input().split())) for i in range(n)]
bld=[[[0 for i in range(10)] for j in range(3)] for k in range(4)]

for ny in nyukyo:
    bld[ny[0]-1][ny[1]-1][ny[2]-1]+=ny[3]

for i,b in enumerate(bld):
    for f in b:
        print("",*f)
    if i != 3:
        print("####################")
Buggy code:
n = int(input())

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

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

for i, building in enumerate(nums):
    for floor in building:
        print(' '.join(map(str, floor)))
    if i != 3:
        print('#'*20)
    

Fixed code:
n = int(input())

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


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

for i, building in enumerate(nums):
    for floor in building:
        print('', ' '.join(map(str, floor)))
    if i != 3:
        print('#'*20)
Buggy code:
n = int(input())
data = [list(map(int, input().split())) for _ in range(n)]
nums = [[[0 for i in range(10)] for i in range(3)] for i in range(4)]
for d in data:
    nums[d[0] - 1][d[1] - 1][d[2] - 1] += d[3]
for i in range(4):
    for j in range(3):
        for k in range(10):
            print(' ' + nums[i][j][k], end='')
        print('')
    if i != 3:
        print('#' * 20)

Fixed code:
n = int(input())
data = [list(map(int, input().split())) for _ in range(n)]
nums = [[[0 for i in range(10)] for i in range(3)] for i in range(4)]
for d in data:
    nums[d[0] - 1][d[1] - 1][d[2] - 1] += d[3]
for i in range(4):
    for j in range(3):
        for k in range(10):
            print(' ' + str(nums[i][j][k]), end='')
        print('')
    if i != 3:
        print('#' * 20)
Buggy code:
n = int(input())
apartment = [[[0 for r in range(10)] for f in range(3)] for b in range(4)]
for _ in range(n):
    b, f, r, v = map(int, input().split())
    apartment[b-1][f-1][r-1] += v
for b in range(4):
    if(b != 0):
        print('#' * 20)
    for f in range(3):
        print(' '.join(map(str, apartment[b][f])))


Fixed code:
table = [[[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())
    table[b-1][f-1][r-1] += v
for i in range(4):
    for j in range(3):
        print(" " + " ".join(map(str, table[i][j])))
    if i != 3:
        print("#" * 20)
Buggy code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

B = 4
F = 3
R = 10
SHARPS = 20

def main():
    """
    The function to be called when this script is run as a script.
    
    """
    
    info_number = int(input())
    given_info_str = (info.split() for info in (
        input() for _ in range(info_number)))
    given_info_int = (list(map(int, info)) for info in given_info_str)
    houses = [[[0 for i in range(R)] for j in range(F)] for k in range(B)]
    for info in given_info_int:
        houses[info[0] - 1][info[1] - 1][info[2] - 1] += info[3]
    for num, building in enumerate(houses):
        for floor in building:
            print (" ".join(map(str, floor)))
        if num < (B - 1):
            print("#" * 20)

if __name__ == "__main__":
    main()

Fixed code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

B = 4
F = 3
R = 10
SHARPS = 20

def main():
    """
    The function to be called when this script is run as a script.
    
    """
    
    info_number = int(input())
    given_info_str = (info.split() for info in (
        input() for _ in range(info_number)))
    given_info_int = (list(map(int, info)) for info in given_info_str)
    houses = [[[0 for i in range(R)] for j in range(F)] for k in range(B)]
    for info in given_info_int:
        houses[info[0] - 1][info[1] - 1][info[2] - 1] += info[3]
    for num, building in enumerate(houses):
        for floor in building:
            print (" " + " ".join(map(str, floor)))
        if num < (B - 1):
            print("#" * 20)

if __name__ == "__main__":
    main()
Buggy code:
import sys
n = int(input())

A=[[['0' for _ in range(10)] for _ in range(3)] for _ in range(4)]
#0??§?????????
#[[[0 0 0 0 0 0 0 0 0 0],
#  [0 0 0 0 0 0 0 0 0 0],
#  [0 0 0 0 0 0 0 0 0 0]],
# [[0 0 0 0 0 0 0 0 0 0],
#  [0 0 0 0 0 0 0 0 0 0],
#  [0 0 0 0 0 0 0 0 0 0]],
# [[0 0 0 0 0 0 0 0 0 0],  
#  [0 0 0 0 0 0 0 0 0 0],
#  [0 0 0 0 0 0 0 0 0 0]],
# [[0 0 0 0 0 0 0 0 0 0],
#  [0 0 0 0 0 0 0 0 0 0],
#  [0 0 0 0 0 0 0 0 0 0]]]

#?£?    Building = b
#???    Floor    = f
#???    Room     = r
#??°    Number   = num
for i in range(n):
	b,f,r,num = input().strip().split()
	A[int(b)-1][int(f)-1][int(r)-1]=num

for i in range(4):
	for j in range(3):
		sys.stdout.write(' ')
		sys.stdout.write(' '.join(A[i][j]))
		sys.stdout.write(' ')
		print()
	if i!=3:
		print('#'*20)

Fixed code:
import sys
n = int(input())

A=[[[0 for _ in range(10)] for _ in range(3)] for _ in range(4)]
#0??§?????????
#[[[0 0 0 0 0 0 0 0 0 0],
#  [0 0 0 0 0 0 0 0 0 0],
#  [0 0 0 0 0 0 0 0 0 0]],
# [[0 0 0 0 0 0 0 0 0 0],
#  [0 0 0 0 0 0 0 0 0 0],
#  [0 0 0 0 0 0 0 0 0 0]],
# [[0 0 0 0 0 0 0 0 0 0],  
#  [0 0 0 0 0 0 0 0 0 0],
#  [0 0 0 0 0 0 0 0 0 0]],
# [[0 0 0 0 0 0 0 0 0 0],
#  [0 0 0 0 0 0 0 0 0 0],
#  [0 0 0 0 0 0 0 0 0 0]]]

#?£?    Building = b
#???    Floor    = f
#???    Room     = r
#??°    Number   = num
for i in range(n):
	b,f,r,num = input().strip().split()
	A[int(b)-1][int(f)-1][int(r)-1]+=int(num)

for i in range(4):
	for j in range(3):
		print('',' '.join(map(str,A[i][j])))
	if i!=3:
		print('#'*20)
Buggy code:
data = [[[0 for r in range(10)] for f in range(3)] for b in range(4)]

count = int(input())

for c in range(count):
    (b, f, r, v) = [int(x) for x 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()
    print('#' * 20) if b < 4 - 1 else print(end='')

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

count = int(input())

for c in range(count):
    (b, f, r, v) = [int(x) for x 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()
    print('#' * 20) if b < 4 - 1 else print(end='')
Buggy code:
rooms = [[[0] * 10 for b in range(3)] for a in range(4)]
n = int(input())
for _ in range(n):
    b, f, r, v = map(int, input().split())
    rooms[b - 1][f - 1][r - 1] += v

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

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

for i in range(4):
    for j in range(3):
        print(' ' + ' '.join(map(str, rooms[i][j])))
    if i < 3:
        print('#' * 20)
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()
    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:
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):
         
for bi, b in enumerate(data):
    for f in b:
        for r in f:
            print(' {0}'.format(r), end='')

        print()

    if bi < 3:
        print('#' * 20)

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

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

for bi, b in enumerate(data):
    for f in b:
        for r in f:
            print(' {0}'.format(r), end='')

        print()

    if bi < 3:
        print('#' * 20)