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:
arr = [[[0 for i in range(10)] for j in range(3)] for k in range(4)]
for i in range(int(input())):
    b,f,r,v = map(int, input().split())
    arr[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(arr[i][j][k])
            else:
                print(arr[i][j][k], end=" ")
    if i != 3:
        print("#"*20)

Submission status: WA: Presentation Error

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

for x in range(4):
    for y in range(3):
        print(*l[x][y])
    if x != 3:
        print("####################")

Submission status: WA: Presentation Error

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

for x in range(4):
    for y in range(3):
        print()
        print(*l[x][y])
    if x != 3:
        print("####################")

Submission status: WA: Presentation Error

Solution code:
n = int(input())
a =[[[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())

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

for i in range(4):
    for j in range(3):
        for k in range(10):
            print(" ", a[i][j][k], end=' ')
        print()
    if i != 3:
        print("#" * 20)

Submission status: WA: Presentation Error

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

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

Submission status: WA: Presentation Error

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 = map(int, input().split())
	a[b-1][f-1][r-1] += v

for k in range(4):
	for j in range(3):
		for i in range(10):
			print(" {}".format(a[k][j][i]), end="")
		print("")
	if not k == 3: print("#" * 20)
print("")

Submission status: WA: Presentation Error

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 = map(int, input().split())
	a[b-1][f-1][r-1] += v

for k in range(4):
	for j in range(3):
		for i in range(10):
			print(" {}".format(a[k][j][i]), end="")
		print("")
	if not k == 3: print("#" * 20)
	else: print("")
print("")

Submission status: WA: Presentation Error

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 = map(int, input().split())
	a[b-1][f-1][r-1] += v

for k in range(4):
	for j in range(3):
		for i in range(10):
			print(" {}".format(a[k][j][i]), end="")
		print("")
	if not k == 3: print("#" * 20)
print("")
print("")

Submission status: WA: Presentation Error

Solution code:
data = [                                                                               
    [[0 for r in range(10)] for i in range(3)] for b in range(4)                       
    ]                                                                                  
                                                                                       
n = int(input())                                                                       
                                                                                       
for i in range(n):                                                                     
    b, f, r, v = [int(i) for i in input().split()]                                     
    data[b-1][f-1][r-1] += v                                                           
                                                                                       
for bi, b in enumerate(data):                                                          
    for f in b:                                                                        
        print(' ', end='')                                                             
        for r in f:                                                                    
            print('{0}'.format(r), end=' ')                                            
        print()                                                                        
    if bi < 3:                                                                         
        print("#" * 20)

Submission status: WA: Presentation Error

Solution code:
data = [                                                                                
    [[0 for r in range(10)] for i in range(3)] for b in range(4)                        
    ]                                                                                   
                                                                                        
n = int(input())                                                                        
                                                                                        
for i in range(n):                                                                      
    b, f, r, v = [int(i) for i in input().split()]                                      
    data[b-1][f-1][r-1] += v                                                            
                                                                                        
for bi, b in enumerate(data):                                                           
    for f in b:                                                                         
        for r in f:                                                                     
            print(' {0}'.format(r), end=' ')                                            
        print()                                                                         
    if bi < 3:                                                                          
        print("#" * 20)

Submission status: WA: Presentation Error

Solution code:
x = int(input())
a = []
for i in range(1, 120 + 1):
    a.append(0)
for d in range(1, x + 1):
    f, t, y, r = [int(l) for l in input().split()]
    if r < 0:
        a[((30 * (f - 1)) + (10 * (t - 1)) + y) - 1] = a[((30 * (f - 1)) + (10 * (t - 1)) + y) - 1] + r
    else:
        a[((30 * (f - 1)) + (10 * (t - 1)) + y) - 1] = r
for u in (0, 30, 60, 90):
    for b in (u, u + 10, u + 20):
        print(' ', end='')
        for k in range(b, b + 10):
            print(a[k], end=' ')
        print()
    if u < 90:
        print('#' * 20)
    else:
        pass

Submission status: WA: Presentation Error

Solution code:
x = int(input())
a = []
for i in range(1, 120 + 1):
    a.append(0)
for d in range(1, x + 1):
    f, t, y, r = [int(l) for l in input().split()]
    if r < 0:
        a[((30 * (f - 1)) + (10 * (t - 1)) + y) - 1] = a[((30 * (f - 1)) + (10 * (t - 1)) + y) - 1] + r
    else:
        a[((30 * (f - 1)) + (10 * (t - 1)) + y) - 1] = r
for u in (0, 30, 60, 90):
    for b in (u, u + 10, u + 20):
        print(' ', end='')
        for k in range(b, b + 10):
            print(a[k], end=' ')
        print()
    if u < 90:
        print('#' * 20)
    else:
        pass
print()

Submission status: WA: Presentation Error

Solution code:
x = int(input())
a = []
for i in range(1, 120 + 1):
    a.append(0)
for d in range(1, x + 1):
    f, t, y, r = [int(l) for l in input().split()]
    if r < 0:
        a[((30 * (f - 1)) + (10 * (t - 1)) + y) - 1] = a[((30 * (f - 1)) + (10 * (t - 1)) + y) - 1] + r
    else:
        a[((30 * (f - 1)) + (10 * (t - 1)) + y) - 1] = r
for u in (0, 30, 60, 90):
    for b in (u, u + 10, u + 20):
        print(' ', end='')
        for k in range(b, b + 10):
            print(a[k], end=' ')
        print()
    if u < 90:
        print('#' * 20,' ',sep='')
    else:
        pass

Submission status: WA: Presentation Error

Solution code:
x = int(input())
a = []
for i in range(1, 120 + 1):
    a.append(0)
for d in range(1, x + 1):
    f, t, y, r = [int(l) for l in input().split()]
    if r < 0:
        a[((30 * (f - 1)) + (10 * (t - 1)) + y) - 1] = a[((30 * (f - 1)) + (10 * (t - 1)) + y) - 1] + r
    else:
        a[((30 * (f - 1)) + (10 * (t - 1)) + y) - 1] = r
for u in (0, 30, 60, 90):
    for b in (u, u + 10, u + 20):
        print(' ', end='')
        for k in range(b, b + 10):
            print(a[k], end=' ')
        print()
    if u < 90:
        print('#' * 20,' ',sep='')
    else:
        pass
print()

Submission status: WA: Presentation Error

Solution code:
x = int(input())
a = []
for i in range(1, 120 + 1):
    a.append(0)
for d in range(1, x + 1):
    f, t, y, r = [int(l) for l in input().split()]
    if r < 0:
        a[((30 * (f - 1)) + (10 * (t - 1)) + y) - 1] = a[((30 * (f - 1)) + (10 * (t - 1)) + y) - 1] + r
    else:
        a[((30 * (f - 1)) + (10 * (t - 1)) + y) - 1] = r
for u in (0, 30, 60, 90):
    for b in (u, u + 10, u + 20):
        print(' ', end='')
        for k in range(b, b + 10):
            print(a[k], end=' ')
        print()
    if u < 90:
        print('#' * 20,' ',sep='')
    else:
        print()

Submission status: WA: Presentation Error

Solution code:
x = int(input())
a = []
for i in range(1, 120 + 1):
    a.append(0)
for d in range(1, x + 1):
    f, t, y, r = [int(l) for l in input().split()]
    if r < 0:
        a[((30 * (f - 1)) + (10 * (t - 1)) + y) - 1] = a[((30 * (f - 1)) + (10 * (t - 1)) + y) - 1] + r
    else:
        a[((30 * (f - 1)) + (10 * (t - 1)) + y) - 1] = r
for u in (0, 30, 60, 90):
    for b in (u, u + 10, u + 20):
        for k in range(b, b + 10):
            print(" ",a[k],end='',sep='')
        print()
    if u < 90:
        print('#' * 20,' ',sep='')
    else:
        pass

Submission status: WA: Presentation Error

Solution code:
x = int(input())
a = []
for i in range(1, 120 + 1):
    a.append(0)
for d in range(1, x + 1):
    f, t, y, r = [int(l) for l in input().split()]
    if r < 0:
        a[((30 * (f - 1)) + (10 * (t - 1)) + y) - 1] = a[((30 * (f - 1)) + (10 * (t - 1)) + y) - 1] + r
    else:
        a[((30 * (f - 1)) + (10 * (t - 1)) + y) - 1] = r
for u in (0, 30, 60, 90):
    for b in (u, u + 10, u + 20):
        for k in range(b, b + 10):
            print(" ",a[k],end='',sep='')
        print()
    if u < 90:
        print('#' * 20,' ',sep='')
    else:
        print()

Submission status: WA: Presentation Error

Solution code:
x = int(input())
a = []
for i in range(1, 120 + 1):
    a.append(0)
for d in range(1, x + 1):
    f, t, y, r = [int(l) for l in input().split()]
    if r < 0:
        a[((30 * (f - 1)) + (10 * (t - 1)) + y) - 1] = a[((30 * (f - 1)) + (10 * (t - 1)) + y) - 1] + r
    else:
        a[((30 * (f - 1)) + (10 * (t - 1)) + y) - 1] = r
for u in (0, 30, 60, 90):
    for b in (u, u + 10, u + 20):
        for k in range(b, b + 10):
            print(" ",a[k],end='',sep='')
        print()
    if u < 90:
        print('#' * 20)
    else:
        print()

Submission status: WA: Presentation Error

Solution code:
x = int(input())
a = []
for i in range(1, 120 + 1):
    a.append(0)
for d in range(1, x + 1):
    f, t, y, r = [int(l) for l in input().split()]
    if r < 0:
        a[((30 * (f - 1)) + (10 * (t - 1)) + y) - 1] = a[((30 * (f - 1)) + (10 * (t - 1)) + y) - 1] + r
    else:
        a[((30 * (f - 1)) + (10 * (t - 1)) + y) - 1] = r
for u in (0, 30, 60, 90):
    for b in (u, u + 10, u + 20):
        for k in range(b, b + 10):
            print(" {0}".format(a[k]),end='',sep='')
        print()
    if u < 90:
        print('#' * 20)
    else:
        print()

Submission status: WA: Presentation Error

Solution code:
N = int(input())
A = [[[0] * 10, [0] * 10, [0] * 10], [[0] * 10, [0] * 10, [0] * 10], [[0] * 10, [0] * 10, [0] * 10], [[0] * 10, [0] * 10, [0] * 10]]

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

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

Submission status: WA: Presentation Error

Solution code:
a = [[[0 for z in range(10)] for y in range(3)] for x in range(4)]
n = int(input())
for i in range(n):
    b, f, r, v = [int(x) for x in input().split()]
    a[b - 1][f - 1][r - 1] += v

for i in range(4):
    for j in range(3):
        print(*a[i][j])
    if i != 3:
        print('#' * 20)

Submission status: WA: Presentation 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='')
            if k != 9:
                print(' ', end='')
        print('')
    if i != 3:
        print('#' * 20)

Submission status: WA: Presentation Error

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

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

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

for i in L:
    for j in i:
        print "",
        for k in j:
            print "{}".format(k),
        print ""
    if i is not L[3] :print "#" *20

Submission status: WA: Presentation Error

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

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

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

for i in L:
    for j in i:
        print "",
        for k in j:
            print "{}".format(k),
        print ""
    if i is not L[3] :print "#" *20,""

Submission status: WA: Presentation Error

Solution code:
n = int(raw_input())

room = [[[0 for i in range(10)] for j in range(3)] for k in range(4)]
for i in range(n):
    b, f, r, v = map(int, raw_input().split())
    room[b-1][f-1][r-1] += v
    
for i in range(4):
    for j in range(3):
        for k in range(10):
            print room[i][j][k],
        print ''
    if i != 3:
        print "####################"

Submission status: WA: Presentation Error

Solution code:
n = int(raw_input())

room = [[[0 for i in range(10)] for j in range(3)] for k in range(4)]
for i in range(n):
    b, f, r, v = map(int, raw_input().split())
    room[b-1][f-1][r-1] += v
    
for i in range(4):
    for j in range(3):
        print '',
        for k in range(10):
            print room[i][j][k],
        print ''
    if i != 3:
        print "####################"

Submission status: WA: Presentation Error

Solution code:
n = int(raw_input())

room = [[[0 for i in range(10)] for j in range(3)] for k in range(4)]
for i in range(n):
    b, f, r, v = map(int, raw_input().split())
    room[b-1][f-1][r-1] += v
    
for i in range(4):
    for j in range(3):
        print "",
        for k in range(10):
            print room[i][j][k],
        print ''
    if i != 3:
        print "####################"

Submission status: WA: Presentation Error

Solution code:
n = int(raw_input())

room = [[[0 for i in range(10)] for j in range(3)] for k in range(4)]
for i in range(n):
    b, f, r, v = map(int, raw_input().split())
    room[b-1][f-1][r-1] += v
    
for i in range(4):
    for j in range(3):
        print'',
        for k in range(10):
            print "%d" % (room[i][j][k]),
        print ''
    if i != 3:
        print "#"*20

Submission status: WA: Presentation Error

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

Submission status: WA: Presentation Error

Solution code:
b1 = [[0 for i in range(10)] for j in range(3)]
b2 = [[0 for i in range(10)] for j in range(3)]
b3 = [[0 for i in range(10)] for j in range(3)]
b4 = [[0 for i in range(10)] for j in range(3)]

n = int(input())
i = 1
while i <= n:
    b, f, r, v = map(int, input().split())
    if (b == 1):
        b1[f-1][r-1] += v
    elif (b == 2):
        b2[f-1][r-1] += v
    elif (b == 3):
        b3[f-1][r-1] += v
    elif (b == 4):
        b4[f-1][r-1] += v
    i += 1

for i in [0, 1, 2]:
    print(' '.join(map(str, b1[i])))
print('#' * 20)
for i in [0, 1, 2]:
    print(' '.join(map(str, b2[i])))
print('#' * 20)
for i in [0, 1, 2]:
    print(' '.join(map(str, b3[i])))
print('#' * 20)
for i in [0, 1, 2]:
    print(' '.join(map(str, b4[i])))

Submission status: WA: Presentation Error

Solution code:
b1 = [[0 for i in range(10)] for j in range(3)]
b2 = [[0 for i in range(10)] for j in range(3)]
b3 = [[0 for i in range(10)] for j in range(3)]
b4 = [[0 for i in range(10)] for j in range(3)]

n = int(input())
i = 1
while i <= n:
    b, f, r, v = map(int, input().split())
    if (b == 1):
        b1[f-1][r-1] += v
    elif (b == 2):
        b2[f-1][r-1] += v
    elif (b == 3):
        b3[f-1][r-1] += v
    elif (b == 4):
        b4[f-1][r-1] += v
    i += 1

for i in range(3):
    print(' '.join(map(str, b1[i])))
print('#' * 20)
for i in range(3):
    print(' '.join(map(str, b2[i])))
print('#' * 20)
for i in range(3):
    print(' '.join(map(str, b3[i])))
print('#' * 20)
for i in range(3):
    print(' '.join(map(str, b4[i])))

Submission status: WA: Presentation Error

Solution code:
n = [int(input())]

house = ['0' * 30, '0' * 30, '0' * 30, '0' * 30]
hr = '#' * 20

for nn in range(n[0]):
  bfrv = [int(x) for x in input().split()]

  b = bfrv[0] - 1
  f = bfrv[1] - 1
  r = bfrv[2] - 1
  v = bfrv[3]

  pos = (f * 10) + r
  humal = int(house[b][pos]) + v

  house[b] = house[b][:pos] + str(humal) + house[b][pos + 1:]

for ii in range(4):
  print(house[ii][:10])
  print(house[ii][10:20])
  print(house[ii][20:])
  if ii != 3:
    print(hr)

Submission status: WA: Presentation Error

Solution code:
def aaa(strArg):
  str = ''
  for c in strArg:
    str += c + ' '
  return str

n = [int(input())]

house = ['0' * 30, '0' * 30, '0' * 30, '0' * 30]
hr = '#' * 20

for nn in range(n[0]):
  bfrv = [int(x) for x in input().split()]

  b = bfrv[0] - 1
  f = bfrv[1] - 1
  r = bfrv[2] - 1
  v = bfrv[3]

  pos = (f * 10) + r
  humal = int(house[b][pos]) + v

  house[b] = house[b][:pos] + str(humal) + house[b][pos + 1:]

for ii in range(4):
  print(aaa(house[ii][:10]).rstrip())
  print(aaa(house[ii][10:20]).rstrip())
  print(aaa(house[ii][20:]).rstrip())
  if ii != 3:
    print(hr)

Submission status: WA: Presentation Error

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

Solution code:
rooms = [0]*120

n = int(input())

for i in range(n):
    mover = list(map(int, input().split()))
    rooms[(mover[0]-1)*30 + (mover[1]-1)*10 + (mover[2]-1)] += mover[3]

point = 0
count = 0

for i in range(11*15):
    if point%11 == 0:
        print("")
        point += 1
    elif (point > 33 and point < 44) or (point > 77 and point < 88)or (point > 121 and point < 132):
          print("##", end="")
          point += 1
    else:
        print(" " + str(rooms[count]), end="")
        point += 1
        count += 1

Submission status: WA: Presentation Error

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

Submission status: WA: Presentation Error

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

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

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('####################' if i!=3 else '')

Submission status: WA: Presentation Error

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

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

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

Submission status: WA: Presentation Error

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

Submission status: WA: Presentation Error

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

Submission status: WA: Presentation Error

Solution code:
h = [ [ [ 0 for x in range(0, 10) ] for y in range(0, 3) ] for z in range(0, 4) ]
for i in range(0, int(input())):
    b,f,r,v = map(int, input().split())
    h[b-1][f-1][r-1] += v
c = 1
for x in h:
    for y in x:
        print(" ".join(map(str, y)))
    if c < 4:
        print("#" * 20)
    c += 1

Submission status: WA: Presentation Error

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], end="")
        print()

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

Submission status: WA: Presentation Error

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

Submission status: WA: Presentation Error

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="")
			if z != 9:
				print(" ", end="")
		print()
	if x != 3:
		print(("#"*20))

Submission status: WA: Presentation Error

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

Submission status: WA: Presentation Error

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:
        print(' '.join(map(str, y)))
    if i < 4 - 1:
        print('####################')

Submission status: WA: Presentation Error

Solution code:
import sys

a=[]
for t in range(4):
    a.append([])
    for f in range(3):
        a[t].append([])
        for r in range(10):
            a[t][f].append(0)

lines = [line for line in sys.stdin]

n = lines[0]

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

for i,t in enumerate(a):
    for f in t:
        print (" ".join(map(str,f)))
    if len(a) != i +1:
        print ('#'*20)

Submission status: WA: Presentation Error

Solution code:
# -*- Coding: utf-8 -*-
# ???????????????
info = [[[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 = map(int,list(input().split()))
    info[b-1][f-1][r-1] += v

# ???????????????
for i in range(4):
    if i != 0:
        print('####################')
    for j in range(3):
        print(' '.join(map(str,info[i][j])))

Submission status: WA: Presentation Error

Solution code:
info = [[[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 = map(int,list(input().split()))
    info[b-1][f-1][r-1] += v

for i in range(4):
    if i != 0:
        print('####################')
    for j in range(3):
        print(' '.join(map(str,info[i][j])))

Submission status: WA: Presentation Error

Solution code:
#!usr/bin/env python3

import sys


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


def occupy_buildings(empty_buildings):
    occupied_buildings = generate_buidlings(4, 3, 10)
    n = int(sys.stdin.readline())

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

    return occupied_buildings


def format_buildings():
    res = ''
    separator = '####################'
    occupied_buildings = occupy_buildings(generate_buidlings(4, 3, 10))

    for idx, (key, value) in enumerate(occupied_buildings.items()):
        for floor in value:
            res += ' %s %s %s %s %s %s %s %s %s %s\n' % tuple(floor)
        if idx < 3:
            res += '%s\n' % separator
    return res


def main():
    print(format_buildings())


if __name__ == '__main__':
    main()