qyliang/CodeNanoFix huggingface dataset:
Buggy code:
data = [                                                                                
    [[0 for r in range(10)] for i 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 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 i 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 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:
house = [[[0 for i in range(10)] for i in range(3)] for i in range(4)]
n = int(input())
for i in range(n):
    input_4 = list(map(int,input().split()))
    house[input_4[0]-1][input_4[1]-1][input_4[2]-1] = input_4[3]
for i in range(4):
    for j in range(3):
        print(' '.join(map(str,house[i][j])))
    if i != 3:
        print('#'*20)

Fixed code:
house = [[[0 for i in range(10)] for i in range(3)] for i in range(4)]
n = int(input())
for i in range(n):
    input_4 = list(map(int,input().split()))
    house[input_4[0]-1][input_4[1]-1][input_4[2]-1] += input_4[3]
for i in range(4):
    for j in range(3):
        print('',' '.join(map(str,house[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()
    if b < 4:
        print( '#' * 20)
    else:
        print()

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:
num = [[[0 for i in range(10)] for j in range(3)] for k in range(4)]
b, f, r, v, n, x, y, z  = 0, 0, 0, 0, 0, 0, 0, 0
n = int(input())
for i in range(n):
	b, f, r, v = list(map(int, input().split()))
	num[b - 1][f - 1][r - 1] = v
for i in range(4):
	if y >= 1:
		z = 0
		y = 0
		x += 1
		print()
		print('####################')
	for i in range(3):
		if z >= 1:
			z = 0
			y += 1
			print('')
		for i in range(10):
			print(num[x][y][z], end = ' ')
			z += 1

Fixed code:
num = [[[0 for i in range(10)] for j in range(3)] for k in range(4)]
b, f, r, v, v1, n, x, y, z  = 0, 0, 0, 0, 0, 0, 0, 0, 0
n = int(input())
for i in range(n):
	b, f, r, v = list(map(int, input().split()))
	num[b - 1][f - 1][r - 1] += v
for i in range(4):
	if y >= 1:
		z = 0
		y = 0
		x += 1
		print()
		print('####################')
	for i in range(3):
		if z >= 1:
			z = 0
			y += 1
			print('')
		for i in range(10):
			print('', num[x][y][z], end = '')
			z += 1
print()
Buggy code:
table = [[[ 0 for i in range(10)] for j in range(3)] for k in range(4)]

n = int(input())

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

    i += 1

for i,elem_i in enumerate(table):           # building
    for j,elem_j in enumerate(elem_i):      # floor
        for k, elem_k in enumerate(elem_j): # room
            print (" " + str(elem_k), end='')
        print ("")
    if i != 3:
        print ("###################")


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

n = int(input())

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

    i += 1

for i,elem_i in enumerate(table):           # building
    for j,elem_j in enumerate(elem_i):      # floor
        for k, elem_k in enumerate(elem_j): # room
            print (" " + str(elem_k), end='')
        print ("")
    if i != 3:
        print ("####################")
Buggy code:
#ITP1_6_C
A=[[[0 for k in range(10)]for j in range(3)]for i in range(4)]
format(A)
n=int(input())
for m in range(n):
  b,f,r,v=map(int,input().split())
  S=A[b-1][f-1][r-1]+v
  A[b-1][f-1][r-1]=S
for i in range(4):
  for j in range(3):
    for k in range(10):
      print ("",A[i][j][k],end='')
    print("\n")
  if i<3:
    print("####################")
  




Fixed code:
#ITP1_6_C
A=[[[0 for k in range(10)]for j in range(3)]for i in range(4)]
format(A)
n=int(input())
for m in range(n):
  b,f,r,v=map(int,input().split())
  S=A[b-1][f-1][r-1]+v
  A[b-1][f-1][r-1]=S
for i in range(4):
  for j in range(3):
    for k in range(10):
      print ("",A[i][j][k],end='')
    print("")
  if i<3:
    print("####################")
Buggy code:
def print_list(lst) :
	a = ' '.join(list(map(str, lst)))
	print(a)

n = int(input())
lst = [[[0 for w in range(10)] for q in range(3)] for e in range(4)]
for _ in range(n):
	b,f,r,v = list(map(int, input().split()))
	lst[b-1][f-1][r-1] = v 
for i in range(4):
	if (i != 0):
		print("#" * 20)
	for j in range(3):
		print_list(lst[i][j])

Fixed code:
def print_list(lst) :
    a = ' '.join(list(map(str, lst)))
    print(" " + a)


lst = [[[0 for q in range(10)] for w in range(3)] for e in range(4)]

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

for i in range(4):
	if (i != 0):
		print("#"*20)
	for j in range(3):
		print_list(lst[i][j])
Buggy code:
#coding:utf-8

n = int(input().rstrip())
tatemono=[
[[0 for i in range(10)],[0 for i in range(10)],[0 for i in range(10)]],
[[0 for i in range(10)],[0 for i in range(10)],[0 for i in range(10)]],
[[0 for i in range(10)],[0 for i in range(10)],[0 for i in range(10)]],
[[0 for i in range(10)],[0 for i in range(10)],[0 for i in range(10)]]]

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

for i in range(3):
    for j in range(3):
        print(" ".join(list(map(str, tatemono[i][j]))))

    print("####################")

for i in range(3):
    print(" ".join(list(map(str, tatemono[3][i]))))

Fixed code:
#coding:utf-8

n = int(input().rstrip())
tatemono=[
[[0 for i in range(10)],[0 for i in range(10)],[0 for i in range(10)]],
[[0 for i in range(10)],[0 for i in range(10)],[0 for i in range(10)]],
[[0 for i in range(10)],[0 for i in range(10)],[0 for i in range(10)]],
[[0 for i in range(10)],[0 for i in range(10)],[0 for i in range(10)]]]

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

for i in range(3):
    for j in range(3):
        print(" " + " ".join(list(map(str, tatemono[i][j]))))

    print("####################")

for i in range(3):
    print(" " + " ".join(list(map(str, tatemono[3][i]))))
Buggy code:
n = int(input())
data = [[[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 = [int(s) for s in input().split(' ')]
	data[b-1][f-1][r-1] += v

while data:
	building = data.pop(0)
	for floor in building:
		rooms = ' '.join([str(room) for room in floor])
		print(rooms)
	if data:
		print('####################')

Fixed code:
n = int(input())
data = [[[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 = [int(s) for s in input().split(' ')]
	data[b-1][f-1][r-1] += v

while data:
	building = data.pop(0)
	for floor in building:
		rooms = ' ' + ' '.join([str(room) for room in floor])
		print(rooms)
	if data:
		print('####################')
Buggy 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('')



Fixed 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('')
Buggy code:
n=int(input())
a=[[[0]*10 for i in range(3)] for j 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 i in range(4):
    for j in range(3):
        for e in range(10):
            print(' '+str(a[i][j][e]),end='')
        print()
    print('#'*20)


Fixed code:
n=int(input())
a=[[[0]*10 for i in range(3)] for j 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 i in range(4):
    for j in range(3):
        for e in range(10):
            print(' '+str(a[i][j][e]),end='')
        print()
    if i!=3:
        print('#'*20)
Buggy code:
n = int(input())
public_hall = [[[],[],[]],[[],[],[]],[[],[],[]],[[],[],[]]]
input_info = []

for b in range(4):
    for f in range(3):
        for r in range(10):
            public_hall[b][f].append(0)

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

for j in range(n):
    public_hall[input_info[j][0] - 1][input_info[j][1] - 1][input_info[j][2] - 1] += input_info[j][3]

for k in range(4):
    for l in range(3):
        for m in range(10):
            print('', public_hall[k][l][m],end='')
        print()
    for n in range(20):
        print('#',end='')
    if not k == 3:
        print()

Fixed code:
n = int(input())
public_hall = [[[],[],[]],[[],[],[]],[[],[],[]],[[],[],[]]]
input_info = []

for b in range(4):
    for f in range(3):
        for r in range(10):
            public_hall[b][f].append(0)

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

for j in range(n):
    public_hall[input_info[j][0] - 1][input_info[j][1] - 1][input_info[j][2] - 1] += input_info[j][3]

for k in range(4):
    for l in range(3):
        for m in range(10):
            print('', public_hall[k][l][m],end='')
        print()
    if k != 3:
        print('#' * 20)
Buggy code:
n = int(input())
record = [ [ [0 for r in range(10)] for f in range(3)] for b in range(4)]
for _ in range(n):
    b,f,r,v = [int(i) for i in input().split(" ")]
    record[b - 1][f - 1][r - 1] += v
for b1 in range(4):
    for f in record[b1]:
        for x in f:
            print(x)
    if b1 != 3:
        print("#" * 20)
        
        

Fixed code:
n = int(input())
record = [ [ [0 for r in range(10)] for f in range(3)] for b in range(4)]
for _ in range(n):
    b,f,r,v = [int(i) for i in input().split(" ")]
    record[b - 1][f - 1][r - 1] += v
for b1 in range(4):
    for f in record[b1]:
        print(" "+" ".join([str(x) for x in f]))
    if b1 != 3:
        print("#" * 20)
Buggy code:
data = [[[0 for i in range(10)] for j in range(3)] for h in range(4)]
n = int(input())
for o in range(n):
    a = input().split()
    b = int(a[0])
    f = int(a[1])
    r = int(a[2])
    v = int(a[3])
    data[b - 1][f - 1][r - 1] = v
    count = 0
    counta = 0
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 i in range(10)] for j in range(3)] for h in range(4)]
n = int(input())
for o in range(n):
    a = input().split()
    b = int(a[0])
    f = int(a[1])
    r = int(a[2])
    v = int(a[3])
    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=[int('0') for i in range(10)]
w=["#" for i in range(20)]
z=[]
for i in range(15):
    z+=[a]
    if i == 3 or i== 7 or i== 11:
        z+=[w]
x=[[[0 for i in range(10)] for k in range(3)] for j 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 i in range(4):
    for k in range(3):
        print(" ".join(str(x[i][k][o]) for o in range(10)))
    if i ==0 or i ==1 or i==2:
        print("#"*20)
    
    
        
    

    

Fixed code:
a=[int('0') for i in range(10)]
w=["#" for i in range(20)]
z=[]
for i in range(15):
    z+=[a]
    if i == 3 or i== 7 or i== 11:
        z+=[w]
x=[[[0 for i in range(10)] for k in range(3)] for j 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 i in range(4):
    for k in range(3):
        print(" "+" ".join(str(x[i][k][o]) for o in range(10)))
    if i ==0 or i ==1 or i==2:
        print("#"*20)
Buggy code:
n = int(input())
record = [ [ [0 for r in range(10)] for f in range(3)] for b in range(4)]
for _ in range(n):
    b,f,r,v = [int(i) for i in input().split(" ")]
    record[b - 1][f - 1][r - 1] += v
for b1 in range(4):
    for f in record[b1]:
        print(" ".join([str(x) for x in f]))
    if b1 != 3:
        print("#" * 20)
        
        

Fixed code:
record=[[[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(x) for x in input().split()]
    record[b-1][f-1][r-1]+=v
for b in range(4):
    for f in record[b]: print(" "+" ".join([str(x) for x in f]))
    if b != 3:
        print("".join(["#" for x in range(20)]))
Buggy code:
n = int(input())
record =  [ [ [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(a) for a in input().split(" ")]
    record[b - 1][ f - 1][r - 1] += v
for b in range(4):
    for f in record[b]:
        print( " "+" ".join( [str(x) for x in f] ) )
    if b != 3:
        print("#" * 20)
        

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

n = int(input())

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

for i in range(4):
    for f in num[i]:
        print(""," ".join([str(x) for x in f]))
    
    if i != 3:
        print("#"*20)
Buggy code:
All = [[[0 for x in range(10)] for y in range(3)] for z in range(4)]

N = int(input())

i = 0
while i < N:
	b, f, r, v = map(int,input().split())
	All[b-1][f-1][r-1] += v
	i += 1

for x in range(4):
	for y in range(3):
		for z in range(10):
			print(" {}".format(All[x][y][z]), end = "")
			if z == 9:
				print("")
	if y == 2:
		for j in range(20):
			print("#", end = "")
		print("")

Fixed code:
All = [[[0 for x in range(10)] for y in range(3)] for z in range(4)]

N = int(input())

i = 0
while i < N:
	b, f, r, v = map(int,input().split())
	All[b-1][f-1][r-1] += v
	i += 1

for x in range(4):
	for y in range(3):
		for z in range(10):
			print(" {}".format(All[x][y][z]), end = "")
			if z == 9:
				print("")
	if x != 3 and y == 2:
		for j in range(20):
			print("#", end = "")
		print("")
Buggy code:
a = [[[0 for i in range(10)]for i in range(3)]for i in range(4)]
for i in range(4):
    a.append(np.zeros((3,10), dtype = int))
border = '#'*20
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 i in range(4):
    for k in a[i]:
        for l in k:
                print(' {}'.format(l), end ='')
        print()
    if i != 3:
        print(border)


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

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


Fixed code:
n=int(input())
start=[[[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=[int(i) for i in input().split()]
    start[b-1][f-1][r-1]+=v
for i in range(4):
    for j in range(3):
        for k in range(10):
            print(" ",end="")
            print(start[i][j][k],end="")
        print()
    if i<=2:
        for m in range(20):
            print("#",end="")
        print()
Buggy code:
from sys import stdin

rooms = [[[0] * 10 for _ in range(3)] for _ in range(4)]
stdin.readline().rstrip()
while True:
    try:
        b, f, r, v = [int(x) for x in stdin.readline().rstrip().split()]
        rooms[b-1][f-1][r-1] += v
    except:
        break

for b in range(4):
    for f in range(3):
        print(*rooms[b][f])
    else:
        if b != 3:
            print("#"*20)



Fixed code:
from sys import stdin

rooms = [[[0] * 10 for _ in range(3)] for _ in range(4)]
stdin.readline().rstrip()
while True:
    try:
        b, f, r, v = [int(x) for x in stdin.readline().rstrip().split()]
        rooms[b-1][f-1][r-1] += v
    except:
        break

for b in range(4):
    for f in range(3):
        print(" ", end = "")
        print(*rooms[b][f])
    else:
        if b != 3:
            print("#"*20)
Buggy code:
room=[[[0 for i in range(10)]for j in range(3)]for k in range(4)]

for i in range(int(input())):
	n=list(map(int,input().split()))
	room[n[0]-1][n[1]-1][n[2]-1]=n[3]
n=0
for i in room:
	for j in i:
		print(' '.join(list(map(str,j))))
		if n==2 or n==5or n==8:
			print('####################')
		n+=1


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

for i in range(int(input())):
	n=list(map(int,input().split()))
	room[n[0]-1][n[1]-1][n[2]-1]+=n[3]
n=0
for i in room:
	for j in i:
		print(' '+' '.join(list(map(str,j))))
		if n==2 or n==5or n==8:
			print('####################')
		n+=1
Buggy code:
# -*- coding: utf-8 -*-
n = int(input())
Univ = [[[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 =[int(i)for i in input().split(' ')]
    Univ[b-1][f-1][r-1] += v

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

Fixed code:
# -*- coding: utf-8 -*-
n = int(input())
Univ = [[[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 =[int(i)for i in input().split(' ')]
    Univ[b-1][f-1][r-1] += v

for b in range(4):
    for f in range(3):
        for r in range(10):
            print('',Univ[b][f][r],end="")
        print()
    if b<3:
        print("#"*20)
Buggy code:
F = [[[0] * 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())
 F[b-1][f-1][r-1] += v
for x in range(0, 4):
 for y in range(0, 3):
  for z in range(0, 9):
   print(" {0}".format(F[x][y][z]), end = '')
  print(F[x][y][z+1])
 if x != 3:
  print("#" * 20)

Fixed code:
F = [[[0] * 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())
 F[b-1][f-1][r-1] += v
for x in range(0, 4):
 for y in range(0, 3):
  for z in range(0, 10):
   print(" {0}".format(F[x][y][z]), end = '')
  print()
 if x != 3:
  print("#" * 20)
Buggy code:
# -*- coding: utf-8 -*-

import sys
import os


def get_house():
    return [[0 for i in range(10)] for j in range(3)]

def print_house(h):
    for i in range(3):
        for j in range(10):
            print(' ', end='')
            print(h[i][j], end='')
        print()

houses = []
for i in range(4):
    houses.append(get_house())

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

for i in range(4):
    print_house(houses[i])
    print('####################')

Fixed code:
# -*- coding: utf-8 -*-

import sys
import os


def get_house():
    return [[0 for i in range(10)] for j in range(3)]

def print_house(h):
    for i in range(3):
        for j in range(10):
            print(' ', end='')
            print(h[i][j], end='')
        print()

houses = []
for i in range(4):
    houses.append(get_house())

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

for i in range(4):
    print_house(houses[i])
    if i != 3:
        print('####################')