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: WA: Presentation Error

Solution code:
n = int(input())
A = [[0]*10 for i in range(12)] 

for _ in range(n):
    b, f, r, v = map(int, input().split())
    A[(b-1)*3 + (f-1)][r-1] = v
for i, v in enumerate(A, 1):
    print(' '.join([str(p) for p in v]))
    if i == 3 or i == 6 or i == 9:
        print('####################')

Submission status: WA: Presentation Error

Solution code:
n = int(input())
A = [[0]*10 for i in range(12)] 

for _ in range(n):
    b, f, r, v = map(int, input().split())
    A[(b-1)*3 + (f-1)][r-1] = v
for i, v in enumerate(A, 1):
    print(' '.join([str(p) for p in v]))
    if i == 3 or i == 6 or i == 9:
        print('####################')
print()

Submission status: WA: Presentation Error

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

Submission status: WA: Presentation Error

Solution code:
# ITP1_6_C
# Array - Official House
# http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ITP1_6_C&lang=jp
from sys import stdin

n = int(stdin.readline().rstrip())

NUMBER_OF_BUILDING = 4
FLOORS_PER_BUILDING = 3
ROOMS_PER_FLOOR = 10

official_house = [
    [
        [
            0 for _ in range(ROOMS_PER_FLOOR)
        ] for _ in range(FLOORS_PER_BUILDING)
    ] for _ in range(NUMBER_OF_BUILDING)
]

for cnt in range(n):
    b, f, r, v = (int(n) for n in stdin.readline().rstrip().split())
    official_house[b-1][f-1][r-1] += v

for no, building in enumerate(official_house):
    if no != 0:
        print("#"*20)

    for floor in building:
        print(" ".join(map(str, floor)))

Submission status: WA: Presentation Error

Solution code:
n = int(input())
count = 0
room = [int(0) for i in range(4) for j in range(3) for k in range(10)]
while count < n:
    x = list(map(lambda k: int(k), input().split(" ")))
    room[(x[0]-1)*30+(x[1]-1)*10+(x[2]-1)] += x[3]
    count += 1
for i in range(4):
    if i != 0:
            print("####################")
    for j in range(3):
        for k in range(10):
            if k == 0:
                print("%d" % room[30*i+10*j+k], end="")
            else:
                print(" %d" % room[30*i+10*j+k], end="")
        print("")

Submission status: WA: Presentation Error

Solution code:
n = int(input())
count = 0
room = [int(0) for i in range(4) for j in range(3) for k in range(10)]
while count < n:
    x = list(map(lambda k: int(k), input().split(" ")))
    room[(x[0]-1)*30+(x[1]-1)*10+(x[2]-1)] += x[3]
    count += 1
for i in range(4):
    if i != 0:
        print("####################")
    for j in range(3):
        for k in range(10):
            if k == 0:
                print("%d" % room[30*i+10*j+k], end="")
            else:
                print(" %d" % room[30*i+10*j+k], end="")
        print("")

Submission status: WA: Presentation Error

Solution code:
n=int(raw_input())
buildings=[[[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,raw_input().split())
    buildings[b-1][f-1][r-1]+=v
#print buildings                                                                                                    
for i in range(4):
    for j in range(3):
        ln=''
        for k in range(10):
            ln+=str(buildings[i][j][k])
        print ln
    if i!=3:print '#'*20

Submission status: WA: Presentation Error

Solution code:
l=[[[0 for i in xrange(10)]for j in xrange(3)]for k in xrange(4)]
s='#'*20+'\n'
n=input()
for i in xrange(n):
    b,f,r,v=map(int,raw_input().split())
    l[b-1][f-1][r-1]+=v
for i in xrange(4):
    for j in xrange(-3,0):
        print ' '+' '.join(map(str,l[i][j]))
        if i<3 or j<-1:print
    if i<3:print s

Submission status: WA: Presentation Error

Solution code:
data = []
for i in xrange(4):
	tou = []
	data.append(tou)
	for j in xrange(3):
		kai = [0 for k in xrange(10)]
		tou.append(kai)
n = int(raw_input())
for i in xrange(n):
	b,f,r,v = map(int, raw_input().split(" "))
	data[b-1][f-1][r-1] += v
for tou in data:
	if not tou is data[0]:
		print "#" * 20
	for kai in tou:
		print " ".join(map(str, kai))

Submission status: WA: Presentation Error

Solution code:
import sys

BUILDINGS = tuple(x for x in range(4))
FLOORS = tuple(x for x in range(3))
ROOMS = tuple(x for x in range(10))

occupant = [[[0 for r in ROOMS] for f in FLOORS] for b in BUILDINGS]

n = input() # 読み捨て

for line in sys.stdin:
    b, f, r, v = map(int, line.split())
    occupant[b - 1][f - 1][r - 1] += v
    
for b in BUILDINGS:
    if b:
        print('#' * 20)
    for f in FLOORS:
        print(*occupant[b][f])

Submission status: WA: Presentation 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(x) for x in input().split()]
    data[b - 1][f - 1][r - 1] += v

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

Submission status: WA: Presentation 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(x) for x in input().split()]
    data[b - 1][f - 1][r - 1] += v

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

Submission status: WA: Presentation 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(x) for x in input().split()]
    data[b - 1][f - 1][r - 1] += v

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

Submission status: WA: Presentation Error

Solution code:
floor = [
        [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
         [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
         [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]],

        [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
         [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
         [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]],

        [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
         [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
         [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]],

        [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
         [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
         [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]]
        ]

count = int(input())
for c in range(count):
    (t,f,r,i) = [int(x) for x in input().split()]
    floor[t-1][f-1][r-1] = i

for z in range(4):
    for i in range(len(floor[z])):
        print(end=' ')
        for v in floor[z][i]:
            print(v, end=' ')
        print()
    for h in range(20):
        if not z == 3:
            print('#', end='')
    print()

Submission status: WA: Presentation Error

Solution code:
floor = [
        [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
         [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
         [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]],

        [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
         [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
         [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]],

        [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
         [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
         [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]],

        [[0, 0, 0, 0, 0, 0, 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 c in range(n):
    (t,f,r,i) = [int(x) for x in input().split()]
    floor[t-1][f-1][r-1] = i

for z in range(4):
    for i in range(len(floor[z])):
        print(end=' ')
        for v in floor[z][i]:
            print(v, end=' ')
        print()
    if not z == 3:
        for h in range(20):
                print('#', end='')
    print()

Submission status: WA: Presentation Error

Solution code:
floor = [
        [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
         [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
         [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]],

        [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
         [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
         [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]],

        [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
         [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
         [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]],

        [[0, 0, 0, 0, 0, 0, 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 c in range(n):
    (t,f,r,i) = [int(x) for x in input().split()]
    floor[t-1][f-1][r-1] = i

for z in range(4):
    for i in range(len(floor[z])):
        print(end=' ')
        for v in floor[z][i]:
            print(v, end=' ')
        print()
    if not z == 3:
        for h in range(20):
                print('#', end='')
        print()

Submission status: WA: Presentation Error

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

count = int(input())

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

for b in range(4):
    for f in range(3):
        for r in range(10):
            print(data[b][f][r], '', end='')
        print()

    if b == count:
        break
    for x in range(20):
        print('#',end='')
    print()

Submission status: WA: Presentation Error

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

count = int(input())

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

for b in range(4):
    for f in range(3):
        for r in range(10):
            if r == 10:
                print(data[b][f][r], end='')
            else:
                print(data[b][f][r], '', end='')
        print()

    if b == count:
        break
    for x in range(20):
        print('#',end='')
    print()

Submission status: WA: Presentation Error

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

count = int(input())

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

for b in range(4):
    for f in range(3):
        for r in range(10):
            if r == 9:
                print(data[b][f][r], end='')
            else:
                print(data[b][f][r], '', end='')
        print()

    if b == count:
        break
    for x in range(20):
        print('#',end='')
    print()

Submission status: WA: Presentation Error

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

count = int(input())

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

for b in range(4):
    for f in range(3):
        print(' ',end='')
        for r in range(10):
                print(data[b][f][r], '', end='')
        print()

    if b == 3:
        break
    for x in range(20):
        print('#',end='')
    print()

Submission status: WA: Presentation Error

Solution code:
floor = [
        [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
         [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
         [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]],

        [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
         [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
         [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]],

        [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
         [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
         [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]],

        [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
         [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
         [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]]
        ]
s = '####################'
n = int(input())
for c in range(n):
    (t,f,r,i) = [int(x) for x in input().split()]
    floor[t-1][f-1][r-1] = i

for z in range(4):
    for i in range(len(floor[z])):
        print(end=' ')
        for v in floor[z][i]:
            print(v, end=' ')
        print()
    if not z == 3:
        print(s)

Submission status: WA: Presentation Error

Solution code:
floor = [
        [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
         [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
         [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]],

        [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
         [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
         [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]],

        [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
         [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
         [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]],

        [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
         [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
         [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]]
        ]

s = '####################'
n = int(input())
for c in range(n):
    (t,f,r,i) = [int(x) for x in input().split()]
    floor[t-1][f-1][r-1] = i

for z in range(4):
    for i in range(len(floor[z])):
        print(end=' ')
        for v in floor[z][i]:
            print(v, end=' ')
        print()
    if not z == 3:
        print(s)

Submission status: WA: Presentation Error

Solution code:
floor = [
        [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
         [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
         [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]],

        [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
         [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
         [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]],

        [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
         [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
         [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]],

        [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
         [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
         [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]]
        ]
s = '####################'

n = int(input())
for c in range(n):
    (t,f,r,i) = [int(x) for x in input().split()]
    floor[t-1][f-1][r-1] = i

for z in range(4):
    for i in range(len(floor[z])):
        print(end=' ')
        for v in floor[z][i]:
            print(v, end='')
            if not i == len(floor[z]):
                print(end=' ')
        print()
    if not z == 3:
        print(s)

Submission status: WA: Presentation Error

Solution code:
import sys

n = input()
x = {}

for i in range(1,5):
    for j in range(1,4):
        for k in range(1,11):
            x[(i,j,k)] = 0

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

for i in range(1,5):
    for j in range(1,4):
        for k in range(1,11):
            sys.stdout.write(' ')
            sys.stdout.write(str(x[(i,j,k)]))
        print
    if(i != 4):
        for l in range(20):
            sys.stdout.write('#')
    print
exit(0)

Submission status: WA: Presentation Error

Solution code:
import sys

n = input()
x = {}

for i in range(1,5):
    for j in range(1,4):
        for k in range(1,11):
            x[(i,j,k)] = 0

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

for i in range(1,5):
    for j in range(1,4):
        print ''
        for k in range(1,11):
            print x[(i,j,k)],
            #sys.stdout.write(' ')
            #sys.stdout.write(str(x[(i,j,k)]))
    print
    if(i != 4):
        for l in range(20):
            sys.stdout.write('#')
exit(0)

Submission status: WA: Presentation Error

Solution code:
import sys

n = input()
x = {}

for i in range(1,5):
    for j in range(1,4):
        for k in range(1,11):
            x[(i,j,k)] = 0

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

for i in range(1,5):
    for j in range(1,4):
        for k in range(1,11):
            sys.stdout.write(' ')
            sys.stdout.write(str(x[(i,j,k)]))
        print
    if(i != 4):
        for l in range(20):
            sys.stdout.write('#')
        print
print
exit(0)

Submission status: WA: Presentation Error

Solution code:
dic = {}
for b in range(1,5):
    for f in range(1,4):
        for r in range(1,11):
            dic[(b,f,r)] = 0

n = int(raw_input())
for k in range(n):
    b,f,r,v = map(int,raw_input().split())
    dic[(b,f,r)] += v

j = 0
for b in range(1,5):
    for f in range(1,4):
        ls = []
        for r in range(1,11):
            ls.append(dic[(b,f,r)])
        print ' '.join(map(str,ls))
        
    else:
        if j < 3:
            print '#'*20
        j +=1

Submission status: WA: Presentation Error

Solution code:
l=[0]*120
s="#"*20
for i in range(input()):b,f,r,v=map(int,raw_input().split());l[b*30+f*10+r-41]+=v
print "",
for i in range(120):
 print l[i],;j=i+1
 if j%30==0 and j!=120:print "\n"+s,
 if j%10==0:print;print "",

Submission status: WA: Presentation Error

Solution code:
l=[0]*120
s="#"*20
for i in range(input()):b,f,r,v=map(int,raw_input().split());l[b*30+f*10+r-41]+=v
print "",
for i in range(120):
 print l[i],;j=i+1
 if j==120:break
 if j%30==0:print "\n"+s,
 if j%10==0:print;print "",

Submission status: WA: Presentation Error

Solution code:
l=[0]*120
s="#"*20
for i in range(input()):b,f,r,v=map(int,raw_input().split());l[b*30+f*10+r-41]+=v
print "",
for i in range(120):
 print l[i],;j=i+1
 if j==120:break
 if j%30==0:print "\n"+s,
 if j%10==0:print;print "",
print

Submission status: WA: Presentation Error

Solution code:
l=[0]*120
s="#"*20
for i in range(input()):b,f,r,v=map(int,raw_input().split());l[b*30+f*10+r-41]+=v
print "",
for i in range(120):
 print l[i],;j=i+1
 if j==120:break
 if j%30==0:print "\n"+s,
 if j%10==0:print;print "",
print
print

Submission status: WA: Presentation Error

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

class residence(object):
	def __init__(self):
		one = [0] * 10
		two = [0] * 10
		three = [0] * 10
		self.all = [one, two, three]

residences = [ ]

for i in xrange(4):
	residences.append(residence())

n = int(raw_input())

for i in xrange(n):
	b, f, r, v = map(int, raw_input().split())
	residences[b-1].all[f-1][r-1] += v

for i, residence in enumerate(residences):
	for floor in residence.all:
		for index, num in enumerate(floor):
			if index == len(floor) - 1:
				print num
			else:
				print num,
	if i == len(residences) - 1:
		print
	else:
		print '####################'

Submission status: WA: Presentation Error

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

class residence(object):
	def __init__(self):
		one = [0] * 10
		two = [0] * 10
		three = [0] * 10
		self.all = [one, two, three]

residences = [ ]

for i in xrange(4):
	residences.append(residence())

n = int(raw_input())

for i in xrange(n):
	b, f, r, v = map(int, raw_input().split())
	residences[b-1].all[f-1][r-1] += v

for i, residence in enumerate(residences):
	for floor in residence.all:
		for index, num in enumerate(floor):
			if index == len(floor) - 1:
				print num
			else:
				print num,
	if i != len(residences) - 1:
		print '####################'

Submission status: WA: Presentation Error

Solution 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)
    else:
        print()

Submission status: WA: Presentation Error

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

Submission status: WA: Presentation Error

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

Submission status: WA: Presentation Error

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

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

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

if __name__ == "__main__":
    main()

Submission status: WA: Presentation Error

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

Submission status: WA: Presentation Error

Solution code:
build = range(1, 5)
floor = range(1, 4)
dic = {}
for b in build:
    dic[b] = {}
    for f in floor:
        dic[b][f] = [0]*10

n = input()
for i in range(n):
    info = map(int, raw_input().split())
    dic[info[0]][info[1]][info[2]-1] += info[3]
    if dic[info[0]][info[1]][info[2]-1] > 9:
        print 'error'

for b in build:
    for f in floor:
        print ' '.join(map(str, dic[b][f]))
    if b != 4:
        print "#"*20

Submission status: WA: Presentation Error

Solution code:
build = range(1, 5)
floor = range(1, 4)
dic = {}
for b in build:
    dic[b] = {}
    for f in floor:
        dic[b][f] = [0]*10

n = input()
for i in range(n):
    info = map(int, raw_input().split())
    dic[info[0]][info[1]][info[2]-1] += info[3]
    if dic[info[0]][info[1]][info[2]-1] > 9:
        print 'error'

for b in build:
    for f in floor:
        print ' ',
        print ' '.join(map(str, dic[b][f]))
    if b != 4:
        print "#"*20

Submission status: WA: Presentation Error

Solution code:
import sys

n = input()
a_uni = [[[0 for i in range(10)]for i in range(3)]for i in range(4)]
for i in range(n):
	b,f,r,v = map(int,raw_input().split())
	a_uni[b-1][f-1][r-1] += v
for i in range(4):
	for j in range(3):
		for k in range(10):
			if k==9:
				print(a_uni[i][j][k])
			else :
				sys.stdout.write(str(a_uni[i][j][k]))
				sys.stdout.write(' ')
	if not i==3:
		print '####################'

Submission status: WA: Presentation Error

Solution code:
import sys

n = input()
a_uni = [[[0 for i in range(10)]for i in range(3)]for i in range(4)]
for i in range(n):
	b,f,r,v = map(int,raw_input().split())
	a_uni[b-1][f-1][r-1] += v
for i in range(4):
	for j in range(3):
		for k in range(10):
			if k==9:
				print(a_uni[i][j][k])
			else :
				sys.stdout.write(str(a_uni[i][j][k]))
				sys.stdout.write(' ')
	if not i==3:
		print '####################'
	else :
		print''

Submission status: WA: Presentation Error

Solution code:
import sys

n = input()
a_uni = [[[0 for i in range(10)]for i in range(3)]for i in range(4)]
for i in range(n):
	b,f,r,v = map(int,raw_input().split())
	a_uni[b-1][f-1][r-1] += v
for i in range(4):
	for j in range(3):
		for k in range(10):
			if k==9 and i==3 and j==2:
				sys.stdout.write(str(a_uni[i][j][k]))
			elif k==9:
				print(a_uni[i][j][k])
			else :
				sys.stdout.write(str(a_uni[i][j][k]))
				sys.stdout.write(' ')
	if not i==3:
		print '####################'

Submission status: WA: Presentation Error

Solution code:
def showrooms(building,floor,rooms):
    for x in xrange(0,floor):
        for y in xrange(0,rooms):
            print building[x][y],
        print ""
FLOOR = 3
ROOMS = 10
n = input()
building1 = [[0 for i in range(ROOMS)] for j in range(FLOOR)]
building2 = [[0 for i in range(ROOMS)] for j in range(FLOOR)]
building3 = [[0 for i in range(ROOMS)] for j in range(FLOOR)]
building4 = [[0 for i in range(ROOMS)] for j in range(FLOOR)]
# for x in xrange(0,n):
for x in xrange(0,n):
    b,f,r,v = map(int,raw_input().split())
    f=f-1
    r=r-1
    if b==1:
        building1[f][r] = v
    elif b==2:
        building2[f][r] = v
    elif b==3:
        building3[f][r] = v
    elif b==4:
        building4[f][r] = v
    else:
        print "your input is invalid format."
        break
showrooms(building1,FLOOR,ROOMS)
print "####################"
showrooms(building2,FLOOR,ROOMS)
print "####################"
showrooms(building3,FLOOR,ROOMS)
print "####################"
showrooms(building4,FLOOR,ROOMS)

Submission status: WA: Presentation Error

Solution code:
house = [[[0 for col in range(10)]for row in range(3)]for layer in range(4)]
n = int(raw_input())
for i in range(n):
    input_line = raw_input().split()
    house[int(input_line[0])-1][int(input_line[1])-1][int(input_line[2])-1] += int(input_line[3])
for i in range(0,4):
    if i != 0:
        print "#"*20
    for j in range(0,3):
        for k in range(0,10):
            if k == 9:
                print house[i][j][k]
            else:
                print house[i][j][k],

Submission status: WA: Presentation Error

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

n = input()
for i in range(0, 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):
            ans += " "+str(a[b][f][r])
        ans += "\n"
    if (b != 3):
        ans += "#"*20+"\n"

print(ans)

Submission status: WA: Presentation Error

Solution code:
n = int(input())

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

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

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

Submission status: WA: Presentation Error

Solution code:
# coding:utf-8

class FLOOR:
    def __init__(self):
        self.room = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]

class BUILD:
    def __init__(self):
        self.floor = [FLOOR(), FLOOR(), FLOOR()]

# 3??????10??¨?±????4?£?
all_rooms = [BUILD(), BUILD(), BUILD(), BUILD()]

# ??\???
n = int(input())
for i in range(n):
    b, f, r, v = map(int, input().split())
    all_rooms[b-1].floor[f-1].room[r-1] += v

for b in range(4):
    for f in range(3):
        display = []
        for r in range(10):
            display.append(str(all_rooms[b].floor[f].room[r]))
        print(' '.join(display))
    if (b < 3):
        print('#'*20)

Submission status: WA: Presentation Error

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

Submission status: WA: Presentation Error

Solution code:
num = int(input())

info = list()
buildings = [[[0 for i in range(10)] for j in range(3)] for k in range(4)]

for i in range(num):
    info = input().split()
    buildings[int(info[0])-1][int(info[1])-1][int(info[2])-1] = int(info[3])

for i, b in enumerate(buildings):
    for f in b:
        print(' '.join(map(str, f)))
    if not i == (len(buildings) - 1):
        print('#'*20)

Submission status: WA: Presentation Error

Solution code:
import sys

S = [[[0 for k in xrange(10)] for j in xrange(3)] for i in xrange(4)]

n = input()

for l in xrange(n):
    b, f, r, v = map(int, raw_input().split())
    S[b - 1][f - 1][r - 1] += v
    
for k in xrange(4):
    for j in xrange(3):
        for i in xrange(9):
            tmp = str(S[k][j][i]) + ' '
            sys.stdout.write(tmp)
        print "%d" % S[k][j][9]
    if k != 3:
        print "#" * 20

Submission status: WA: Presentation Error

Solution code:
n = int(input())
Building = [[[0 for r in range(11)] for f in range(4)] for b in range(5)]
for i in range(n):
    b, f, r, v = map(int, input().split())
    Building[b][f][r] += v

for b in range(1, 5):
    for f in range(1, 4):
        for r in range(1, 11):
            print(str(Building[b][f][r]) + " ", end = "")
        print()
    if b != 4:
        print("####################")

Submission status: WA: Presentation Error

Solution code:
n = int(input())
Building = [[[0 for r in range(11)] for f in range(4)] for b in range(5)]
for i in range(n):
    b, f, r, v = map(int, input().split())
    Building[b][f][r] += v

for b in range(1, 5):
    for f in range(1, 4):
        for r in range(1, 11):
            print(Building[b][f][r], end = "")
            if r != 10:
                print(" ", end = "")
        print()
    if b != 4:
        print("####################")