qyliang/CodeNanoFix huggingface dataset:
Buggy code:
n = int(input())
data = [list(map(int,input().split())) for i in range(n)]
room = [[[0 for k in range(10)] for j in range(3)] for i in range(4)]
for a in data:
    room[a[0]-1][a[1]-1][a[2]-1]=a[3]

for x,i in enumerate(room):
    for j in i:
            print(" ".join(map(str,j)))
    if x <= 2 : print('#'*20)

Fixed code:
n = int(input())
data = [list(map(int,input().split())) for i in range(n)]
room = [[[0 for k in range(10)] for j in range(3)] for i in range(4)]
for a in data:
    room[a[0]-1][a[1]-1][a[2]-1]+=a[3]

for x,i in enumerate(room):
    for j in i:
            print(''," ".join(map(str,j)))
    if x <= 2 : 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(i) 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:
N = int(input())
n = [ map(int, input().split()) for i in range(N) ]
kousya = [ [[0]*10 for i in range(3)] for j in range(4) ]
for b, f, r, v in n:
    kousya[b-1][f-1][r-1] = v
for i in range(4):
    for j in range(3):
        print(*kousya[i][j])
    else:
        if i == 3: break
        print('#' * 20)


Fixed code:
N = int(input())
n = [ map(int, input().split()) for i in range(N) ]
kousya = [ [[0]*10 for i in range(3)] for j in range(4) ]
for b, f, r, v in n:
    kousya[b-1][f-1][r-1] += v
for i in range(4):
    for j in range(3):
        print('', *kousya[i][j])
    else:
        if i == 3: break
        print('#' * 20)
Buggy code:
N = int(input())
A = [[[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, v = [int(j) for j in input().split()]
    A[b-1][f-1][r-1] += v

for a, b in enumerate(A):
    for f in b:
        print(' '.join([str(i) for i in f]))
    else:
        if a != len(A) - 1:
            print('#' * 20)

Fixed code:
N = int(input())
A = [[[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, v = [int(j) for j in input().split()]
    A[b-1][f-1][r-1] += v

for a, b in enumerate(A):
    for f in b:
        print(' ' + ' '.join([str(i) for i in f]))
    else:
        if a != len(A) - 1:
            print('#' * 20)
Buggy code:
n = int(input())
person = [[0 for _ in range(10)] for _ in range(12)]

for _ in range(n):
  b, f, r, v = [int(m) for m in input().split()]
  person[3*(b-1)+f-1][r-1] += v

for index, p in enumerate(person):
  print(" ".join([str(m) for m in p]))
  if (index+1)%3 == 0 and index < len(person)-1:
    print("####################")

Fixed code:
n = int(input())
person = [[0 for _ in range(10)] for _ in range(12)]

for _ in range(n):
  b, f, r, v = [int(m) for m in input().split()]
  person[3*(b-1)+f-1][r-1] += v

for index, p in enumerate(person):
  print(" "+" ".join([str(m) for m in p]))
  if (index+1)%3 == 0 and index < len(person)-1:
    print("####################")
Buggy code:
n=int(input())
a=[[[0 for b in range(10)] for b in range(3)] for b in range(4)]

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

for c in range(4):
    for d in range(3):print('',*a[c][d])
    if c != 3:print('#' *20)

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

for c in range(4):
    for d in range(3):print('',*a[c][d])
    if c != 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 nc 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(' {0}'.format(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 nc 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(' {0}'.format(data[b][f][r]), end='')
    print()
  print('#' * 20) if b < 4 - 1 else print(end='')
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)

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()
    if b < 3:
        print('#' * 20)
Buggy code:
rooms = [[[0 for _ in range(10)] for _ in range(3)] for _ in range(4)]
n = int(input())
for _ in range(n):
    info = list(map(int,input().split()))
    rooms[info[0]-1][info[1]-1][info[2]-1] += info[3]

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

Fixed code:
rooms = [[[0 for _ in range(10)] for _ in range(3)] for _ in range(4)]
n = int(input())
for _ in range(n):
    info = list(map(int,input().split()))
    rooms[info[0]-1][info[1]-1][info[2]-1] += info[3]

for b in range(4):
    for f in rooms[b] :
        print(" " + " ".join(list(map(str,f))))
    if b != 3:
        print("#"*20)
Buggy code:
N = int(input())
a = [map(int,input().split()) for i in range(N)]
arr = [[[0 for i3 in range(10)] for i2 in range(3)] for i1 in range(4)]
for b,f,r,v in a:
    arr[b-1][f-1][r-1] += v
i=1
for bl in arr:
    for fl in bl:
        print(' '.join(map(str,fl)))
    if i != len(arr):
        print('#'*20)
    i += 1

Fixed code:
N = int(input())
a = [map(int,input().split()) for i in range(N)]
arr = [[[0 for i3 in range(10)] for i2 in range(3)] for i1 in range(4)]
for b,f,r,v in a:
    arr[b-1][f-1][r-1] += v
i=1
for bl in arr:
    for fl in bl:
        print(' '+' '.join(map(str,fl)))
    if i != len(arr):
        print('#'*20)
    i += 1
Buggy code:
n =int(input())

S = [[[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())
    S[b-1][f-1][r-1] += v

for i in range(4):
    for j in range(3):
        for k in range(10):
            print(" " + str(S[i][j][k]), end = "")
        print("")
    if i == 4:
        break
    print("####################")

Fixed code:
n =int(input())

S = [[[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())
    S[b-1][f-1][r-1] += v

for i in range(4):
    for j in range(3):
        for k in range(10):
            print(" " + str(S[i][j][k]), end = "")
        print("")
    if i == 3:
        break
    print("####################")
Buggy code:
n = int(input())

ab = 4
af = 3
ar = 10

data = [[[0 for i in range(ar)] for j in range(af)] for k in range(ab)]

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

    data[b - 1][f - 1][r - 1] += v

for i in range(ab):
    if i != 0:
        print('#' * 20)
    for j in range(af):
        print(*data[i][j])



Fixed code:
n = int(input())

ab = 4
af = 3
ar = 10

data = [[[0 for i in range(ar)] for j in range(af)] for k in range(ab)]

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

    data[b - 1][f - 1][r - 1] += v

for i in range(ab):
    if i != 0:
        print('#' * 20)
    for j in range(af):
        print("", *data[i][j])
Buggy code:
arr = [[[0 for i3 in range(10)] for i2 in range(3)] for i1 in range(4)]
for _ in range(int(input())):
    a,b,c,d = map(int,input().split())
    arr[a-1][b-1][c-1] += d
for j1 in range(4):
    for j2 in range(3):
        u = arr[j1][j2]
        print(u[0],u[1],u[2],u[3],u[4],u[5],u[6],u[7],u[8],u[9])
    if j1 == 3:
        break
    print("####################")



Fixed code:
arr = [[[0 for i3 in range(10)] for i2 in range(3)] for i1 in range(4)]
for _ in range(int(input())):
    a,b,c,d = map(int,input().split())
    arr[a-1][b-1][c-1] += d
for j1 in range(4):
    for j2 in range(3):
        u = arr[j1][j2]
        print("",u[0],u[1],u[2],u[3],u[4],u[5],u[6],u[7],u[8],u[9])
    if j1 == 3:
        break
    print("####################")
Buggy code:
place = []
bn,fn,rn=[4,3,10]
for i in range(bn):
    place.append([])
    for j in range(fn):
        place[i].append([])
        for k in range(rn):
            place[i][j].append(0)

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

for i in range(bn):
    for j in range(fn):
        line = ""
        for k in range(rn):
            line += " "
            line += str(place[i][j][k])
        print(line)
    mark = ""
    for i in range(20):
        mark += "#"
    print(mark)

Fixed code:
place = []
bn,fn,rn=[4,3,10]
for i in range(bn):
    place.append([])
    for j in range(fn):
        place[i].append([])
        for k in range(rn):
            place[i][j].append(0)

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

for i in range(bn):
    for j in range(fn):
        line = ""
        for k in range(rn):
            line += " "
            line += str(place[i][j][k])
        print(line)
    if(i == bn -1):
        break
    mark = ""
    for i in range(20):
        mark += "#"
    print(mark)
Buggy code:
n=int(input())
room=[[[ 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[b-1][f-1][r-1]+=v
for i in range(4) :
    for j in range(3) :
        for k in range(10) :
            print(" {}".format(room[i][j][k]),end="")
        print("")
    if i!=3 :
        for l in range(20) :
            print("#",end="")


Fixed code:
room=[ [ [ 0 for k in range(10) ] for j in range(3) ] for i in range(4)]
n=int(input())
for i in range(n) :
    b,f,r,v=map(int,input().split())
    room[b-1][f-1][r-1]+=v
for i in range(4) :
    for j in range(3) :
        for k in range(10) :
            print(" {}".format(room[i][j][k]),end="")
        print("")
    if i!=3 :
        for l in range(20) :
            print("#",end="")
        print("")
Buggy code:
n = int(input())
l = [[[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())
  l[b - 1][f - 1][r - 1] += v
for b in range(4):
  for f in range(3):
    for r in range(10):
      print(" %d" % l[b][f][r], end = "")
    print("")
  print("#" * 20)


Fixed code:
n = int(input())
l = [[[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())
  l[b - 1][f - 1][r - 1] += v
for b in range(4):
  for f in range(3):
    for r in range(10):
      print(" %d" % l[b][f][r], end = "")
    print("")
  if b != 3:
    print("#" * 20)
Buggy 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()


Fixed 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)
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:
import sys

# 1????????¢10??????3????????????4?£????????????????????????????????????????
def make_room_data():
    room_data = []
    for i in range(4):
        one_house = []
        for j in range(3):
            one_floor = []
            for k in range(10):
                one_floor.append(0)

            one_house.append(one_floor)

        room_data.append(one_house)

    return room_data
    
def main():
    room_data = make_room_data()
    n = int(sys.stdin.readline().strip())

    for _ in range(n):
        data = sys.stdin.readline().strip().split(' ')
        b, f, r, v = [int(i) for i in data]
        room_data[b-1][f-1][r-1] += v

    # ????????¨???
    for i in range(4):
        for j in range(3):
            for k in range(10):
                print(' %d' % (room_data[i][j][k]), end='')

            print('')

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

if __name__ == '__main__':
    main()

Fixed code:
import sys

# 1????????¢10??????3????????????4?£????????????????????????????????????????
def make_room_data():
    room_data = []
    for i in range(4):
        one_house = []
        for j in range(3):
            one_floor = []
            for k in range(10):
                one_floor.append(0)

            one_house.append(one_floor)

        room_data.append(one_house)

    return room_data
    
def main():
    room_data = make_room_data()
    n = int(sys.stdin.readline().strip())

    for _ in range(n):
        data = sys.stdin.readline().strip().split(' ')
        b, f, r, v = [int(i) for i in data]
        room_data[b-1][f-1][r-1] += v

    # ????????¨???
    for i in range(4):
        for j in range(3):
            for k in range(10):
                print(' %d' % (room_data[i][j][k]), end='')

            print('')

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

if __name__ == '__main__':
    main()
Buggy code:
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])
    if b != len(arrey) - 1:
        print('####################')

Fixed code:
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('####################')
Buggy code:
nyukyo = [[[0 for i in range(10)] for m in range(3)] for n in range(4)]
num = int(input())
for i in range(num):
    handan = input().split()
    handan = list(map(int, handan))
    nyukyo[handan[0]-1][handan[1]-1][handan[2]-1] += handan[3]

for m in nyukyo[0]:
    t = list(map(str, m))
    print(" ".join(t))
print("#"*20)
for m in nyukyo[1]:
    t = list(map(str, m))
    print(" ".join(t))
print("#"*20)
for m in nyukyo[2]:
    t = list(map(str, m))
    print(" ".join(t))
print("#"*20)
for m in nyukyo[3]:
    t = list(map(str, m))
    print(" ".join(t))

Fixed code:
nyukyo = [[[0 for i in range(10)] for m in range(3)] for n in range(4)]
num = int(input())
for i in range(num):
    handan = input().split()
    handan = list(map(int, handan))
    nyukyo[handan[0]-1][handan[1]-1][handan[2]-1] += handan[3]

for m in nyukyo[0]:
    t = list(map(str, m))
    print(" "+" ".join(t))
print("#"*20)
for m in nyukyo[1]:
    t = list(map(str, m))
    print(" "+" ".join(t))
print("#"*20)
for m in nyukyo[2]:
    t = list(map(str, m))
    print(" "+" ".join(t))
print("#"*20)
for m in nyukyo[3]:
    t = list(map(str, m))
    print(" "+" ".join(t))
Buggy code:
a = [[[0] * 10 for i in range(3)] for j in range(4)]

n = int(input())

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

for i, d in enumerate(a):
    for c in d: print(*c)
    if i != len(a) - 1:
        print("#" * 20)


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

n = int(input())

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

for i, d in enumerate(a):
    for c in d: print("", *c)
    if i != len(a) - 1:
        print("#" * 20)
Buggy code:
x = [[[0 for k in range(10)]for j in range(3)]for i in range(4)]
n = int(input())
for i in range(n):
    [b, f, r, v] = map(int, input().split())
    x[b-1][f-1][r-1] += v

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

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

for b in range(4):
    for f in range(3):
        tmp = list(map(str, x[b][f]))
        print(" "+" ".join(tmp))
    if b!=3:
        print("#"*20)
Buggy code:
num = input()
L = []
house = []
for i in range(int(num)):
    k = input().split()
    k[0] = int(k[0])
    k[1] = int(k[1])
    k[2] = int(k[2])
    k[3] = int(k[3])
    L.append(k)

for i in range(3):
    a = ["","0","0","0","0","0","0","0","0","0","0","0"]
    b = ["","0","0","0","0","0","0","0","0","0","0","0"]
    c = ["","0","0","0","0","0","0","0","0","0","0","0"]
    d = ["#"*20]
    house.append([a,b,c,d])

a = ["","0","0","0","0","0","0","0","0","0","0","0"]
b = ["","0","0","0","0","0","0","0","0","0","0","0"]
c = ["","0","0","0","0","0","0","0","0","0","0","0"]
house.append([a,b,c])

for i in L:
    house[i[0]-1][i[1]-1][i[2]] = str(i[3])

for i in house:
    for j in i:
        k = " ".join(j)
        print(k)



Fixed code:
num = input()
L = []
house = []
for i in range(int(num)):
    k = input().split()
    k[0] = int(k[0])
    k[1] = int(k[1])
    k[2] = int(k[2])
    k[3] = int(k[3])
    L.append(k)

for i in range(3):
    a = ["","0","0","0","0","0","0","0","0","0","0"]
    b = ["","0","0","0","0","0","0","0","0","0","0"]
    c = ["","0","0","0","0","0","0","0","0","0","0"]
    d = ["#"*20]
    house.append([a,b,c,d])

a = ["","0","0","0","0","0","0","0","0","0","0"]
b = ["","0","0","0","0","0","0","0","0","0","0"]
c = ["","0","0","0","0","0","0","0","0","0","0"]
house.append([a,b,c])

for i in L:
    house[i[0]-1][i[1]-1][i[2]] = str(int(house[i[0]-1][i[1]-1][i[2]])+i[3])

for i in house:
    for j in i:
        k = " ".join(j)
        print(k)
Buggy code:
_, *lines = open(0).readlines()
H = [[[0]*10 for i in range(3)] for j in range(4)]
for line in lines:
    b, f, r, v = map(int, line.split())
    H[b-1][f-1][r-1] += v
for i, h in enumerate(H):
    if i:
        print("#"*20)
    for r in h:
        print(*r)


Fixed code:
_, *lines = open(0).readlines()
H = [[[0]*10 for i in range(3)] for j in range(4)]
for line in lines:
    b, f, r, v = map(int, line.split())
    H[b-1][f-1][r-1] += v
for i, h in enumerate(H):
    if i:
        print("#"*20)
    for r in h:
        print("",*r)
Buggy code:
table = [0] * 4*3*10

n = int(input())

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

for i in range(120):
    if i != 0 and i % 30 == 0:
        print("####################")
    print(table[i], end="")
    if i%10 == 9:
        print()
    else:
        print(" ", end="")



Fixed code:
table = [0] * 4*3*10

n = int(input())

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

for i in range(120):
    if i != 0 and i % 30 == 0:
        print("####################")
    print(" %d" % table[i], end="")
    if i%10 == 9:
        print()
Buggy code:
Residents = [[[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 = list(map(int, input().split()))
    Residents[b-1][f-1][r-1] += v
for k in range(4):
    for j in range(3):
        print(' '.join(map(str, Residents[k][j])))
    if k == 3:
        break
    print('####################')

Fixed code:
Residents = [[[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 = list(map(int, input().split()))
    Residents[b-1][f-1][r-1] += v
for k in range(4):
    for j in range(3):
        print(' '+' '.join(map(str, Residents[k][j])))
    if k == 3:
        break
    print('####################')
Buggy code:
n = int(input())

a = []
for i in range(n):
    a.append(list(map(int, input().split())))

b = [[[0 for i in range(10)] for j in range(3)] for k in range(4)]

for i in range(n):
    b[a[i][0] - 1][a[i][1] - 1][a[i][2] - 1] = a[i][3]

for i in range(4):
    for j in range(3):
        b[i][j].insert(0, "")
        print(*b[i][j])
    print("####################")
print()
    

Fixed code:
n = int(input())

a = []
for i in range(n):
    a.append(list(map(int, input().split())))

b = [[[0 for i in range(10)] for j in range(3)] for k in range(4)]

for i in range(n):
    b[a[i][0] - 1][a[i][1] - 1][a[i][2] - 1] += a[i][3]

for i in range(4):
    for j in range(3):
        b[i][j].insert(0, "")
        print(*b[i][j])
    if i == 3:
        break
    print("####################")
Buggy 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 = [int(i) for input().split()]
    l[b-1][f-1][r-1] += v

for b in range(4):
    for f in range(3):
        out = ""
        for r in range(10):
            out += " " + str(l[b][f][r])
        print(out)
    if 3 != b:
        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 = [int(i) for i in input().split()]
    l[b-1][f-1][r-1] += v

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

Fixed code:
a = [[[0 for i in range(10)] for j in range(3)] for k in range(4)]
e = '#' * 20
n = int(input())
for i in range(n):
    b,f,r,v = [int(i) for i in input().split()]
    a[b - 1][f - 1][r - 1] += v
for i in range(4):
        for j in range(3):
            print(' ' + ' '.join(map(str,a[i][j])))
        if(i != 3):
            print(e)