Problem:

Official House

You manage 4 buildings, each of which has 3 floors, each of which consists of 10 rooms. Write a program which reads a sequence of tenant/leaver notices, and reports the number of tenants for each room.

  For each notice, you are given four integers b, f, r and v which represent that v persons entered to room r of fth floor at building b. If v is negative, it means that &minus;v persons left.

Assume that initially no person lives in the building. 

Input

  In the first line, the number of notices n is given. In the following n lines, a set of four integers b, f, r and v which represents ith notice is given in a line. 

Output

For each building, print the information of 1st, 2nd and 3rd floor in this order. For each floor information, print the number of tenants of 1st, 2nd, .. and 10th room in this order. Print a single space character before the number of tenants. Print "####################" (20 '#') between buildings.

Constraints

No incorrect building, floor and room numbers are given.

0 ≤ the number of tenants during the management ≤ 9

Sample Input

3
1 1 3 8
3 2 2 7
4 3 8 1

Sample Output

 0 0 8 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
####################
 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
####################
 0 0 0 0 0 0 0 0 0 0
 0 7 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
####################
 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 1 0 0



Sample input:
3
1 1 3 8
3 2 2 7
4 3 8 1


Sample output:
 0 0 8 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
####################
 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
####################
 0 0 0 0 0 0 0 0 0 0
 0 7 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
####################
 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 1 0 0

Submission status: Wrong Answer

Solution 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("####################")

Submission status: Wrong Answer

Solution 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()

Submission status: Wrong Answer

Solution 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=0
for bl in arr:
    for fl in bl:
        print(' '.join(map(str,fl)))
    if i != len(arr):
        print('#'*20)

Submission status: Wrong Answer

Solution 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=0
for bl in arr:
    for fl in bl:
        print(' '.join(map(str,fl)))
    if i != len(arr):
        print('#'*20)
    i += 1

Submission status: Wrong Answer

Solution 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)

Submission status: Wrong Answer

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

n = int(input())
input_4 = list(map(int,input().split()))

for i in range(n):
    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])))
    print('#'*20)

Submission status: Wrong Answer

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

n = int(input())
input_4 = list(map(int,input().split()))

for i in range(n):
    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)

Submission status: Wrong Answer

Solution 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)

Submission status: Wrong Answer

Solution 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('####################')

Submission status: Wrong Answer

Solution 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('####################')

Submission status: Wrong Answer

Solution code:
#coding:utf-8
x=[[[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=list(map(int,input().split()))

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


for line,i in enumerate(x):
    for j in i:
        for k in j:
            print(" "+str(k),end="")
        print("")

    if line!=n:
        for i in range(20):
            print("#",end="")
        print("")

Submission status: Wrong Answer

Solution code:
habitant_dictionary = {}
for building in range(1, 4 + 1):
    habitant_dictionary[building] = [0] * 30

information_number = int(raw_input())
while 0 < information_number:
    data = [int(x) for x in raw_input().split()]
    habitant_dictionary[data[0]][(int(data[1]) - 1) * 10 + (int(data[2]) - 1)] += int(data[3])
    information_number -= 1

for building in range(1, 4 + 1):
    for i in range(0, 30, 10):
        print(" ".join([str(x) for x in habitant_dictionary[building][i:i + 10]]))
    if building is not 4:
        print('#' * 10)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3

n = int(input())
matrix = []
while n > 0:
    values = [int(x) for x in input().split()]
    matrix.append(values)
    n -= 1

dormitory = [[[0 for z in range(10)] for y in range(3)] for x in range(4)]

for b, f, r, v in matrix:
    dormitory[b - 1][f - 1][r - 1] += v

for i in range(4):
    for j in range(3):
        print(' '.join(str(x) for x in dormitory[i][j]))
    print('#' * 20)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3

n = int(input())
matrix = []
while n > 0:
    values = [int(x) for x in input().split()]
    matrix.append(values)
    n -= 1

official_house = [[[0 for z in range(10)] for y in range(3)] for x in range(4)]

for b, f, r, v in matrix:
    official_house[b - 1][f - 1][r - 1] += v

for i in range(4):
    for j in range(3):
        print('',' '.join(str(x) for x in official_house[i][j]))
    print('#' * 20)

Submission status: Wrong Answer

Solution code:
count = [[[0]*11 for j in range(4)] for i in range(5)]
n = int(input())

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

for b in range(1, 5):
    if b >= 2:
        print("####################")
    for f in range(1, 4):
        for r in range(1, 11):
            print(" ", count[b][f][r], sep="")
        print()

Submission status: Wrong Answer

Solution code:
l=[[["0" for i in range(10)] for i in range(3)] for i in range(4)]
n=int(input())
for i in range(n):
	a,b,c,d=list(map(int,input().split()))
	l[a-1][b-1][c-1]=str(d)
for i in l:
	for j in i:
		print(" "+" ".join(j))
	if not i==l[-1]:
		print("####################")

Submission status: Wrong Answer

Solution code:
l=[[[0 for i in range(10)] for i in range(3)] for i in range(4)]
n=int(input())
for i in range(n):
	a,b,c,d=list(map(int,input().split()))
	l[a-1][b-1][c-1]+=d
for i in l:
	for j in i:
		print(" "+" ".join(list(map(str,j))))
	if not i==l[-1]:
		print("####################")

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Here your code !

num_j = [[[0 for _ in range(10)] for _ in range(3)] for _ in range(4)]

n = int(input())

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

for i in range(4):
    for j in range(3):
        print(" ",end="")       
        print(" ".join(map(str,num_j[i][j])))
    print("#"*20)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Here your code !

num_j = [[[0 for _ in range(10)] for _ in range(3)] for _ in range(4)]

n = int(input())

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

for i in range(4):
    for j in range(3):
        #print(" ",end="")       
        print(" ".join(map(str,num_j[i][j])))
    print("#"*20)

Submission status: Wrong Answer

Solution code:
A = [[[0 for i in range(10)] for i in range(3)] for i in range(4)]

info = int(input())
for i in range(info):
    b,f,r,v = [int(i) for i in input().split()]
    A[b-1][f-1][r-1] = v

for i in range(3):
    print(' '+' '.join([str(i) for i in A[0][i]]))
print('#'*20)
for i in range(3):
    print(' '+' '.join([str(i) for i in A[1][i]]))
print('#'*20)
for i in range(3):
    print(' '+' '.join([str(i) for i in A[2][i]]))
print('#'*20)
for i in range(3):
    print(' '+' '.join([str(i) for i in A[3][i]]))

Submission status: Wrong Answer

Solution 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("####################")

Submission status: Wrong Answer

Solution 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("####################")

Submission status: Wrong Answer

Solution code:
#coding:utf-8

apartment = [[[0 for z in range(10)] for y in range(3)] for x in range(4)]
N = int(input())
for i in range(N):
	data = [int(x) - 1 for x in input().split()]
	apartment[data[0]][data[1]][data[2]] = data[3] + 1
for x in range(4):
	for y in range(3):
		for z in range(10):
			print(apartment[x][y][z], end="")
		print()
	if x != 3:
		print("#"*10)

Submission status: Wrong Answer

Solution code:
#coding:utf-8

apartment = [[[0 for z in range(10)] for y in range(3)] for x in range(4)]
N = int(input())
for i in range(N):
	data = [int(x) - 1 for x in input().split()]
	apartment[data[0]][data[1]][data[2]] = data[3] + 1
for x in range(4):
	for y in range(3):
		for z in range(10):
			print(" " + str(apartment[x][y][z]), end="")
		print()
	if x != 3:
		print(("#"*20))

Submission status: Wrong Answer

Solution code:
#coding:utf-8

apartment = [[[0 for z in range(10)] for y in range(3)] for x in range(4)]
N = int(input())
data = [[int(x) - 1 for x in input().split()] for y in range(N)]
for x in data:
	if x[3] >= 0:
		apartment[x[0]][x[1]][x[2]] = x[3] + 1
for x in range(4):
	for y in range(3):
		for z in range(10):
			print(" " + str(apartment[x][y][z]), end="")
		print()
	if x != 3:
		print(("#"*20))

Submission status: Wrong Answer

Solution code:
#coding:utf-8

apartment = [[[0 for z in range(10)] for y in range(3)] for x in range(4)]
N = int(input())
data = [[int(x) - 1 for x in input().split()] for y in range(N)]
for x in data:
	apartment[x[0]][x[1]][x[2]] += abs(x[3] + 1)
for x in range(4):
	for y in range(3):
		for z in range(10):
			print(" " + str(apartment[x][y][z]), end="")
		print()
	if x != 3:
		print(("#"*20))

Submission status: Wrong Answer

Solution code:
l = [[['0' for i in range(10)] for j in range(3)] for j in range(4)]
for n in range(int(input())):
    b, f, r, v = input().strip().split()
    l[int(b)-1][int(f)-1][int(r)-1] = v
for k in range(4):
    if bool(k):
        print('#'*20)
    for j in l[k]:
        print(' ' + ' '.join(j))

Submission status: Wrong Answer

Solution code:
'''
ITP-1_6-C
 ??¬????????\?±??????°
?????§?????????????????¢????????¨?±?????????????????????¬???????£??????????????????????????????¬????????\?±??????????????????±??????????????????
?????¨?±??????\?±??????°???????????????????????°?????????????????????????????????
n??¶????????±????????????????????????????????±??§?????????????????´??°b, f, r, v????????????????????????
????????????b?£?f??????r???????????¨?±????v??????????????§??\?±????????????¨??????????????????v?????????????????´??????v????????????????????¨??????????????????
???????????¨????????¨?±?????????°?????\?±????????????????????????¨????????????
???Input
????????????????????±?????° n ????????????????????????
?¶??????? n ??¶????????±????????????????????????????????±?????????????????´??° b, f, r, v ????????????????????§??????????????????????????????
???Output
????£???????????????\?±??????°???????????????????????????????£???????????????????????????????????????????????????\?±??????°?????????????????????
?????????????????????????????????????????????????????????????????????????????¨?±??????\?±??????°????????????????????????????????\?±??????°??????????????????????????????????????????????????????
?????????????£?????????????####################(20??????#)??§????????£???????????????
'''
# ??¬????????±
roomDict = {}
for b in range(1, 4 + 1):
    for f in range(1, 3 + 1):
        for r in range(1, 10 + 1):
            roomNum = b * 10 + f * 10 + r
            roomDict[roomNum] = 0
 
# ?????°??????????????????
n = int(input())
for i in range(n):
    input_b, input_f, input_r, input_v = map(int, input().split())
    roomNum = input_b * 10 + input_f * 10 + input_r
    numOfPeople = roomDict[roomNum]
    roomDict[roomNum] = numOfPeople + input_v
 
# ???????????±??????
for b in range(1, 4 + 1):
    for f in range(1, 3 + 1):
        for r in range(1, 10 + 1):
            roomNum = b * 10 + f * 10 + r
            print(" {0}".format(roomDict[roomNum]), end='')
        print('')
    # ????£???????####################(20??????#)?????????
    print("####################")

Submission status: Wrong Answer

Solution code:
'''
ITP-1_6-C
 ??¬????????\?±??????°
?????§?????????????????¢????????¨?±?????????????????????¬???????£??????????????????????????????¬????????\?±??????????????????±??????????????????
?????¨?±??????\?±??????°???????????????????????°?????????????????????????????????
n??¶????????±????????????????????????????????±??§?????????????????´??°b, f, r, v????????????????????????
????????????b?£?f??????r???????????¨?±????v??????????????§??\?±????????????¨??????????????????v?????????????????´??????v????????????????????¨??????????????????
???????????¨????????¨?±?????????°?????\?±????????????????????????¨????????????
???Input
????????????????????±?????° n ????????????????????????
?¶??????? n ??¶????????±????????????????????????????????±?????????????????´??° b, f, r, v ????????????????????§??????????????????????????????
???Output
????£???????????????\?±??????°???????????????????????????????£???????????????????????????????????????????????????\?±??????°?????????????????????
?????????????????????????????????????????????????????????????????????????????¨?±??????\?±??????°????????????????????????????????\?±??????°??????????????????????????????????????????????????????
?????????????£?????????????####################(20??????#)??§????????£???????????????
'''
# ??¬????????±
roomDict = {}
for b in range(1, 4 + 1):
    for f in range(1, 3 + 1):
        for r in range(1, 10 + 1):
            roomNum = b * 100 + f * 10 + r
            roomDict[roomNum] = 0
 
# ?????°??????????????????
n = int(input())
for i in range(n):
    input_b, input_f, input_r, input_v = map(int, input().split())
    roomNum = input_b * 100 + input_f * 10 + input_r
    numOfPeople = roomDict[roomNum]
    roomDict[roomNum] = numOfPeople + input_v
 
# ???????????±??????
for b in range(1, 4 + 1):
    for f in range(1, 3 + 1):
        for r in range(1, 10 + 1):
            roomNum = b * 100 + f * 10 + r
            print(" {0}".format(roomDict[roomNum]), end='')
                # ????£???????####################(20??????#)?????????
        print('')
    print("####################")

Submission status: Wrong Answer

Solution 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])
    print('########################')

Submission status: Wrong Answer

Solution 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])
    print('####################')

Submission status: Wrong Answer

Solution 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(' ' + str(arrey[b][f][r]))
    if b != len(arrey) - 1:
        print('####################')

Submission status: Wrong Answer

Solution 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 = [int(i) for i in input().split()]
    a[b-1][f-1][r-1] = v

for x in a:
    for y in x:
        print(' '.join(map(str, y)))
    print('####################')

Submission status: Wrong Answer

Solution 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 = [int(i) for i in input().split()]
    a[b-1][f-1][r-1] = v

for i, x in enumerate(a):
    for y in x:
        for z in y:
            print(' %d' % z, end='')
        print('')
    if i < 4 - 1:
        print('####################')

Submission status: Wrong Answer

Solution code:
import sys

#fin = open("test.txt", "r")
fin = sys.stdin

num_block = 5
num_floor = 4
num_room = 11

#info = [[[0] * num_room] * num_floor] * num_block
info = [ [ [0 for i in range(num_room)] for i in range(num_floor)] for i in range(num_block)]

#print(info)

n = int(fin.readline())

for i in range(n):
	[b, f, r, v] = list(map(int, fin.readline().split()))
	#[b, f, r, v] = fin.readline().split()

	#print(b, f, r, v)
	info[b][f][r] += v	

for block in info[1:]:
	for floor in block[1:]:
		for room in floor[1:]:
			print(" ", end="")
			print(room, end="")
		print("")
	print("#" * 20)

Submission status: Wrong Answer

Solution code:
import sys
def reviewRe():
    #print ' '.join(map(str,map(str,residence[i][j])))
    for area in range(4):
        for floor in range(3):
            sys.stdout.write(' ')
            print ' '.join(map(str,residence[area][floor][:]))
        print "####################"

def move_in():
    n=input()
    for i in range(n):
        b,f,r,v = map(int,raw_input().split())
        adding(b,f,r,v)

def adding(b,f,r,v):
    residence[b-1][f-1][r-1] = v


if __name__ == '__main__':
    residence = [[[0 for room in range(10)] for floor in range(3)] for area in range(4)]
    move_in()
    reviewRe()

Submission status: Wrong Answer

Solution code:
import sys
def reviewRe():
    #print ' '.join(map(str,map(str,residence[i][j])))
    for area in range(4):
        for floor in range(3):
            sys.stdout.write(' ')
            print ' '.join(map(str,residence[area][floor][:]))
        if area <= 2:
            print "####################"

def move_in():
    n=input()
    for i in range(n):
        b,f,r,v = map(int,raw_input().split())
        adding(b,f,r,v)

def adding(b,f,r,v):
    residence[b-1][f-1][r-1] = v


if __name__ == '__main__':
    residence = [[[0 for room in range(10)] for floor in range(3)] for area in range(4)]
    move_in()
    reviewRe()

Submission status: Wrong Answer

Solution code:
#!usr/bin/env python3

import sys


def generate_buidlings_with_residents(building, floor, room):
    buildings = {
            key: [[0 for col in range(room)] for row in range(floor)]
            for key in range(1, building+1)
    }

    n = int(sys.stdin.readline())
    for i in range(n):
        lst = [int(num) for num in sys.stdin.readline().split()]
        buildings[lst[0]][lst[1]-1][lst[2]-1] += lst[3]

    return buildings


def print_buildings():
    separator = '####################'
    buildings_with_residents = generate_buidlings_with_residents(4, 3, 10)

    for idx, (key, value) in enumerate(buildings_with_residents.items()):
        for floor in value:
            print(' %s %s %s %s %s %s %s %s %s %s' % tuple(floor))
        if key < len(buildings_with_residents):
            print(separator)


def main():
    print_buildings()

Submission status: Wrong Answer

Solution 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("")

Submission status: Wrong Answer

Solution code:
n = int(input())
data = []
for i in range(n):
    b, f, r, v = map(int, input().split())
    data.append(((b,f,r),v))
d = dict(data)
for b in range(1,5):
    for f in range(1,4):
        for r in range(1,11):
            if (b,f,r) in d:
               print(" "+str(d[(b,f,r)]),end="")
            else:
                print(" 0",end="")
        print("")
    if b < 4:
        print("#"*20)

Submission status: Wrong Answer

Solution 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)

Submission status: Wrong Answer

Solution code:
of = [[0 for i in range(10)] for j in range(12)]

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

for i in range(12):
    if i%3 == 0:
        print("####################")
    for j in range(10):
        print(" ",of[i][j],sep="",end="")
    print("")

Submission status: Wrong Answer

Solution 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)

Submission status: Wrong Answer

Solution code:
nums = [[[0 for x in range(0, 10)] for x in range(0, 3)] for x in range(0, 4)]

input1='''1 1 3 8
3 2 2 7
4 3 8 1'''.split("\n")
print(input1)

for e in input1:
    efbv =  e.split(" ")
    e_b, e_f, e_r, e_v = map(int, efbv)
    nums[e_b - 1][e_f - 1][e_r -1] += e_v

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

Submission status: Wrong Answer

Solution 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)

Submission status: Wrong Answer

Solution 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='')
    print()

Submission status: Wrong Answer

Solution 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='')
    print()

Submission status: Wrong Answer

Solution 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()

Submission status: Wrong Answer

Solution code:
res = ['-']
for mak in range(12) :
    tem = ['0' for temp in range(10)]
    res.append(tem)

for mak in range(int(input())) :
    a, b, c, d    = [int(temp) for temp in input().split()]
    if   d > 0 : res[a * b][c] = str(d)
    else       : res[a * b][c] = str(int(res[a * b][c]) - d)

for mak in range(1,13) :
    if mak != 1 and mak % 3 == 1 :
        print('#' * 20)
    print(' '.join(res[mak]))

Submission status: Wrong Answer

Solution code:
res = ['-']
for mak in range(12) :
    tem = ['0' for temp in range(10)]
    res.append(tem)

for mak in range(int(input())) :
    a, b, c, d    = [int(temp) for temp in input().split()]
    if   d > 0 : res[a * b][c - 1] = str(d)
    else       : res[a * b][c - 1] = str(int(res[a * b][c]) - d)

for mak in range(1,13) :
    if mak != 1 and mak % 3 == 1 :
        print('#' * 20)
    print(' '.join(res[mak]))

Submission status: Wrong Answer

Solution code:
res = ['-']
for mak in range(12) :
    tem = ['0' for temp in range(10)]
    res.append(tem)

for mak in range(int(input())) :
    a, b, c, d    = [int(temp) for temp in input().split()]
    if   d > 0 : res[((a - 1) * 3) + b][c - 1] = str(d)
    else       : res[((a - 1) * 3) + b][c - 1] = str(int(res[a * b][c]) - d)

for mak in range(1,13) :
    if mak != 1 and mak % 3 == 1 :
        print('#' * 20)
    print(' '.join(res[mak]))
print(res)

Submission status: Wrong Answer

Solution code:
res = ['-']
for mak in range(12) :
    tem = ['0' for temp in range(10)]
    res.append(tem)

for mak in range(int(input())) :
    a, b, c, d    = [int(temp) for temp in input().split()]
    if   d > 0 : res[((a - 1) * 3) + b][c - 1] = str(d)
    else       : res[((a - 1) * 3) + b][c - 1] = str(int(res[a * b][c]) - d)

for mak in range(1,13) :
    if mak != 1 and mak % 3 == 1 :
        print('#' * 20)
    print('',' '.join(res[mak]))

Submission status: Wrong Answer

Solution 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))

    print("#"*20)

Submission status: Wrong Answer

Solution 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('####################')