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: Runtime Error

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

# ??\?????????????????????????????§????????????????????????????????????
count = int(input(1))
for c in range(count):
    c, f, r, v = [int(1) 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)

Submission status: Runtime Error

Solution 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):
    c, 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)

Submission status: Runtime Error

Solution 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):
    c, f, r, v = [int(i) for i in input().split]
    data[c - 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)

Submission status: Runtime Error

Solution 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):
    c, f, r, v = [int(i) for i in input().split]
    data[bi - 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)

Submission status: Runtime Error

Solution 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):
    c, 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)

Submission status: Runtime Error

Solution 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()
     print()
    if bi < 3:
        print('#' * 20)

Submission status: Runtime Error

Solution 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()
     print()
    if bi < 3:
        print('#' * 20)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution 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()
    print()
  if bi < 3:
     print('#' * 20)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
while True:
    [a,b,c]=[x for x in input().split()]
    a,b=int(a),int(b)
    if a==0 and b==0:
        break
    elif op=="+":
        print(a+b)
    elif op=="-":
        print(a-b)
    elif op=="*":
        print(a*b)
    else:
        print(a//b)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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(j))
	if not i==l[-1]:
		print("####################")

Submission status: Runtime Error

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)zzzzzzzzzz
for i in l:
	for j in i:
		print(" ".join(j))
	if not i==l[-1]:
		print("####################")

Submission status: Runtime Error

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

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


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

Submission status: Runtime Error

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

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


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

Submission status: Runtime Error

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

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


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

Submission status: Runtime Error

Solution code:
mport 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: Runtime Error

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][r] += 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: Runtime Error

Solution code:
l = [[[0 for r in range(10)] for f in range(3)] for b in range(4)]
n = int(input())
for num in range(n):
    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('', l[b][f][r], end='')
        print("")
    if b != 3:
        print("#" * 20)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution 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 - ][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 q in range(20)]))

Submission status: Runtime Error

Solution 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("".join(["#" for q in range(20)]))

Submission status: Runtime Error

Solution code:
from __future__ import print_function

n = input()

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

for i in range(n):
    b,f,r,v = map(int,raw_input().split())
    a[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(a[b][f][r]), end="")
        print()
    if b != 3:

Submission status: Runtime Error

Solution code:
#from __future__ import print_function

n = input()

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

for i in range(n):
    b,f,r,v = map(int,raw_input().split())
    a[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(a[b][f][r]), end="")
        print()
    if b != 3:
        print('#'*20)

Submission status: Runtime Error

Solution code:
n = input()

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

for i in range(n):
    b,f,r,v = map(int,raw_input().split())
    a[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(a[b][f][r]), end="")
        print()
    if b != 3:
        print('#'*20)

Submission status: Runtime Error

Solution code:
N = 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(map(int, input().split()))
    b=a[0]
    f=a[1]
    r=a[2]
    v=a[3]
    arr[b][f][r]+=v
for i in range(3):
    for j in range(3):
        print(" ".join(arr[i][j])
    print("####################")
for j in range(3):
    print(" ".join(arr[3][j])

Submission status: Runtime Error

Solution 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(Residents[k][j]))
    if k == 3:
        break
    print('####################')

Submission status: Runtime Error

Solution 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 c in data:
    for d in c:
        for e in d:
            print(e+' ', end='')
            count += 1
            counta += 1
        if count == 10:
            print()
            count = 0
        if counta == 30 or counta==60 or counta ==90:
            print('#'*20)

Submission status: Runtime Error

Solution code:
n= int(input())
for i in range(n):
    b, f, r, v = input().split()
    fstr= 'f' + f
    rint= int(r) - 1
    vint= int(v)
    if b == '1':
        b1[fstr][rint]+=vint
    elif b == '2':
        b2[fstr][rint]+=vint
    elif b == '3':
        b3[fstr][rint]+=vint
    elif b == '4':
        b4[fstr][rint]+=vint

print(str(b1['f1']).replace(',','')[1:9*2])
print(str(b1['f2']).replace(',','')[1:9*2])
print(str(b1['f3']).replace(',','')[1:9*2])
print('#'*20)

print(str(b2['f1']).replace(',','')[1:9*2])
print(str(b2['f2']).replace(',','')[1:9*2])
print(str(b2['f3']).replace(',','')[1:9*2])
print('#'*20)

print(str(b3['f1']).replace(',','')[1:9*2])
print(str(b3['f2']).replace(',','')[1:9*2])
print(str(b3['f3']).replace(',','')[1:9*2])
print('#'*20)


print(str(b4['f1']).replace(',','')[1:9*2])
print(str(b4['f2']).replace(',','')[1:9*2])
print(str(b4['f3']).replace(',','')[1:9*2])

Submission status: Runtime Error

Solution code:
def out(bnum):
    print(' '+str(bnum['1f']).replace(',','')[1:10*2])
    print(' '+str(bnum['2f']).replace(',','')[1:10*2])
    print(' '+str(bnum['3f']).replace(',','')[1:10*2])

def init(bnum):
    bnum = {'1f': [0]*10, '2f': [0]*10, '3f': [0]*10}
    return bnum
    
n = int(input())
b1 = init(b1)
b2 = init(b2)
b3 = init(b3)
b4 = init(b4)
for i in range(n):
    b, f, r, v = input().split()
    f += 'f'
    rint = int(r) - 1
    vint = int(v)
    if b == '1':
        b1[f][rint]+=vint
    elif b == '2':
        b2[f][rint]+=vint
    elif b == '3':
        b3[f][rint]+=vint
    elif b == '4':
        b4[f][rint]+=vint

out(b1)
print('#'*20)
out(b2)
print('#'*20)
out(b3)
print('#'*20)
out(b4)

Submission status: Runtime Error

Solution code:
house = {1:[[0 for i in range(10)] for j in range(3)], 2:[[0 for i in range(10)] for j in range(3)],
         3:[[0 for i in range(10)] for j in range(3)], 4:[[0 for i in range(10)] for j in range(3)]}
n = int(input())
for i in range(n):
    building, floor, room, people_numbers = [int(j) for j in input().split()]
    house[building][floor - 1][room - 1] = people_numbers

partition = "#"*20
for i in range(4):
    for j in range(3):
        print(" "+ *house[i + 1][j])
        if j == 2 and i != 3: print(partition)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import numpy
a=[[0]*10]*12
n=int(input())
for i in range(n):
    b,f,r,v=map(int,input().split())
    a[ 3*b-4+f, r-1 ] = v
for i in range(12):
    if i > 0 and i%3==0:
        print('#'*20)
    print(*a[i,])

Submission status: Runtime Error

Solution code:
import numpy as np
a=np.array([[0]*10]*12)
n=int(input())
for i in range(n):
    b,f,r,v=map(int,input().split())
    a[ 3*b-4+f, r-1 ] = v
for i in range(12):
    if i > 0 and i%3==0:
        print('#'*20)
    print(*a[i,])

Submission status: Runtime Error

Solution code:
import numpy as np
a=np.array([[0]*10]*12)
n=int(input())
for i in range(n):
    b,f,r,v=map(int,input().split())
    a[ 3*b-4+f, r-1 ] = v
for i in range(12):
    if i > 0 and i%3==0:
        print('#'*20)
    print(' '+*a[i,])

Submission status: Runtime Error

Solution code:
import numpy as np
a=np.array([[0]*10]*12)
n=int(input())
for i in range(n):
    b,f,r,v=map(int,input().split())
    a[ 3*b-4+f, r-1 ] = v
for i in range(12):
    if i > 0 and i%3==0:
        print('#'*20)
    print(' ', end='')
    print(*a[i,])

Submission status: Runtime Error

Solution code:
import numpy as np
a=np.array([[0]*10]*12)
n=int(input())
for i in range(n):
    b,f,r,v=map(int,input().split())
    a[ 3*b-4+f, r-1 ] += v
for i in range(12):
    if i > 0 and i%3==0:
        print('#'*20)
    print(' ', end='')
    print(*a[i,])

Submission status: Runtime Error

Solution code:
import numpy as np
a=np.array([[0]*10]*12)
n=int(input())
for i in range(n):
    b,f,r,v=map(int,input().split())
    a[ 3*b-4+f, r-1 ] += v
for i in range(12):
    if i > 0 and i%3==0:
        print('#'*20)
    print(' ', end='')
    print(' '.join(a[i,]))

Submission status: Runtime Error

Solution code:
import numpy as np
a=np.array([[0]*10]*12)
n=int(input())
for i in range(n):
    b,f,r,v=map(int,input().split())
    a[ 3*b-4+f, r-1 ] += v
for i in range(12):
    if i > 0 and i%3==0:
        print('#'*20)
    print(' ', end='')
    print(' '.join(map(str,a[i,])))

Submission status: Runtime Error

Solution code:
import numpy as np
a=np.array([[0]*10]*12)
n=int(input())
for i in range(n):
    b,f,r,v=map(int,input().split())
    a[ 3*b-4+f, r-1 ] += v
for i in range(12):
    if i > 0 and i%3==0:
        print('#'*20)
    print(' '+' '.join(a[i,]))

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
import numpy

Submission status: Runtime Error

Solution code:
import sys
import numpy as np

def main():
    lines = sys.stdin.readlines()

    # The number of rooms
    rooms = np.array([0] * 10)
    floors = np.array([rooms] * 3)
    buildings = np.array([floors] * 4)

    data_num = 0

    for index, line in enumerate(lines):
        #print(line)
        # rm '\n' from string of a line
        line = line.strip('\n')
        elems = line.split(" ")
        if index == 0:
            data_num = int(elems[0])
        else:
            b = int(elems[0]) - 1   # as index
            f = int(elems[1]) - 1   # as index
            r = int(elems[2]) - 1   # as index
            v = int(elems[3])       # as data
            # print v
            buildings[b][f][r] += v
            # print buildings

    for b_i in range(0, 4):
        for f_i in range(0, 3):
            for r_i in range(0, 10):
                sys.stdout.write(' %d' % buildings[b_i][f_i][r_i])
            sys.stdout.write('\n')
        print "####################"



if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
import sys
import numpy as np

def main():
    lines = sys.stdin.readlines()

    # The number of rooms
    rooms = [0] * 10
    floors = [rooms] * 3
    buildings = [floors] * 4

    data_num = 0

    for index, line in enumerate(lines):
        #print(line)
        # rm '\n' from string of a line
        line = line.strip('\n')
        elems = line.split(" ")
        if index == 0:
            data_num = int(elems[0])
        else:
            b = int(elems[0]) - 1   # as index
            f = int(elems[1]) - 1   # as index
            r = int(elems[2]) - 1   # as index
            v = int(elems[3])       # as data
            # print v
            print buildings[b][f][r]
            ans = []
            for b_i in range(0, 4):
                b_list = []
                for f_i in range(0, 3):
                    f_list = []
                    for r_i in range(0, 10):
                        if b == b_i and f == f_i and r == r_i:
                            f_list.append(buildings[b_i][f_i][r_i] + v)
                        else:
                            # print buildings[b][f][r]
                            f_list.append(buildings[b_i][f_i][r_i])
                    b_list.append(f_list)
                ans.append(b_list)
            # print ans
            buildings = ans
            # [buildings[b][f][r]+=v if ]
            # buildings[b][f][r] = 2
            # print buildings

    for b_i in range(0, 4):
        for f_i in range(0, 3):
            for r_i in range(0, 10):
                sys.stdout.write(' %d' % buildings[b_i][f_i][r_i])
            sys.stdout.write('\n')
        print "####################"



if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
a=[[[0]*10]*3]*4
for _ in range(int(input())):
 b,f,r,v=map(int,input().split())
 a[b-1][f-1][r-1]=v
for i in range(4):
 for j in range(3):
  print(' '.join(a[i][j]))
 print('#'*20)

Submission status: Runtime Error

Solution code:
a=[[[0]*10]*3]*4
for _ in range(int(input())):
 b,f,r,v=map(int,input().split())
 a[b-1][f-1][r-1]=v
for i in range(4):
 for j in range(3):
  print(' '.join(a[i][j]))
 print(('#'*20))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
# coding:utf-8
import sys
n = input()
array = []
for i in range(n):
    array.append(map(int, raw_input().split()))
array.sort()
result = [[]]
index = 0
for i in range(1,n):
    if(array[i - 1][0:3] == array[i][0:3]):
        if(result[index][3]):
            result[index][3] += array[i][3:]
        else:
            result[index][0:3] = array[i][0:3]
            result[index][3] = array[i][3:]
    else:
        index += 1
for i in range(4):
    for j in range(3):
        for k in range(10):
            sys.stdout.write(' ')
            if(i == array[j][0] - 1 and k == array[j][2] - 1):
                print array[j][3],
            else:
                print 0,
        else:
            print
    else:
        if(i != 3):
            print "####################"

Submission status: Runtime Error

Solution code:
from __future__ import print_function
n = int(raw_input())
bilding1 = [[" 0 ","0 ","0 ","0 ","0 ","0 ","0 ","0 ","0 ","0"],
           [" 0 ","0 ","0 ","0 ","0 ","0 ","0 ","0 ","0 ","0"],
           [" 0 ","0 ","0 ","0 ","0 ","0 ","0 ","0 ","0 ","0"]
           ]
bilding2 = [[" 0 ","0 ","0 ","0 ","0 ","0 ","0 ","0 ","0 ","0"],#35~44
           [" 0 ","0 ","0 ","0 ","0 ","0 ","0 ","0 ","0 ","0"],#46~55
           [" 0 ","0 ","0 ","0 ","0 ","0 ","0 ","0 ","0 ","0"]
           ]
bilding3 = [[" 0 ","0 ","0 ","0 ","0 ","0 ","0 ","0 ","0 ","0"],#69~78
           [" 0 ","0 ","0 ","0 ","0 ","0 ","0 ","0 ","0 ","0"],#80~89
           [" 0 ","0 ","0 ","0 ","0 ","0 ","0 ","0 ","0 ","0"]
           ]
bilding4 = [[" 0 ","0 ","0 ","0 ","0 ","0 ","0 ","0 ","0 ","0"],#103~112
           [" 0 ","0 ","0 ","0 ","0 ","0 ","0 ","0 ","0 ","0"],#114~123
           [" 0 ","0 ","0 ","0 ","0 ","0 ","0 ","0 ","0 ","0"]
           ]
bilding = []
bilding.append(bilding1)
bilding.append(bilding2)
bilding.append(bilding3)
bilding.append(bilding4)

for i in range(0,n):
    inf = raw_input()
    inf= inf.split(" ")
    b = int(inf[0]) -1
    f = int(inf[1]) -1
    r = int(inf[2]) -1
    v = str(inf[3])
    bilding[b][f][r] = int(bilding[b][f][r]) + v
    if(r == 0):
        bilding[b][f][r] = " " + str(bilding[b][f][r]) + " "
    else:
        bilding[b][f][r] = str(bilding[b][f][r]) + " "
count = 0
for j in range(0,4):
    for k in range(0,3):
        for l in range(0,10):
            print((bilding[j][k][l]),end="")
        print("")
    if(count < 3):
        print("####################")
        count += 1

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import sys

n = int(sys.stdin.readline())
values =[ [ int(val) for val in num[:-1].split() ] for num in sys.stdin.readlines() ]

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

for value in values:
    nyukyo[value[0]-1][value[1]-1][value[2]-1] = value[3]


for j in range(4):
    for n in range(3):
        for m in range(10):
            print( ' ' + nyukyo[j][n][m], end='')
        print()
    print('#' * 20)

print()

Submission status: Runtime Error

Solution code:
n=int(input())

field=[[0 for i in range(20)] for j in range(15)]



for i in range (n):
     b,f,r,v=map(int,input().split())
     field[(b-1)*4+f-1][r*2-1]+=v
for i in range(15):
     for j in range(20):
          if y%4==3:field[y][x]='#'
          elif x%2==0:field[y][x]=' '
　　　print ( field[y][x],end="")
     print()

Submission status: Runtime Error

Solution code:
n=int(input())
field=[[0 for i in range(20)]for j in range(15)]
for i in range(n):
    b,f,r,v=map(int,input().split())
    h=(b-1)*4+f-1
    w=r*2-1
    n=v
    field[h][w]+=n
for y in range(15):
    for x in range(20):
        if(y%4==3):field[y][x]='#'e
        elif x%2==0 :field[y][x]=' '
        print(field[y][x],end='')
    print()

Submission status: Runtime Error

Solution code:
n=int(input())
field=[[0 for i in range(20)]for j in range(15)]
for i in range(n):
    b,f,r,v=map(int,input().split())
    h=(b-1)*4+f-1
    w=r*2-1
    n=v
    field[h][w]+=n
for y in range(15):
    for x in range(20):
        if(y%4==3):field[y][x]='#'
        elif x%2==0 :field[y][x]=' '
        print(field[y][x],end='')
    print()

Submission status: Runtime Error

Solution code:
n=int(input())
field=[[0 for i in range(20)]for j in range(15)]
for i in range(n):
    b,f,r,v=map(int,input().split())
    h=(b-1)*4+f-1
    w=r*2-1
    n=v
    field[h][w]+=n
for y in range(15):
    for x in range(20):
        if(y%4==3):field[y][x]='#'
        elif (x%2==0) :field[y][x]=' '
        print(field[y][x],end='')
    print()