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())
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 = "")
        if b != 4 or b != 3:
            print()
    if b != 4:
        print("####################")

Submission status: WA: Presentation Error

Solution code:
n = int(raw_input())

Mem = [[[0 for i in range(10)] for j in range(3)] for k in range(4)]

for i in range(n):
    C = map(int, raw_input().split())
    Mem[C[0]-1][C[1]-1][C[2]-1] += C[3]

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

Submission status: WA: Presentation Error

Solution code:
n = int(raw_input())

Mem = [[[0 for i in range(10)] for j in range(3)] for k in range(4)]

for i in range(n):
    C = map(int, raw_input().split())
    Mem[C[0]-1][C[1]-1][C[2]-1] += C[3]

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

Submission status: WA: Presentation Error

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

n = input()

for i in range(n):
    Inf = map(int, raw_input().split())

    Adr[Inf[0]-1][Inf[1]-1][Inf[2]-1] += Inf[3]

for b in range(4):
    for f in range(3):
        print "",
        for r in range(10):
            print Adr[b][f][r],
        print ""

    if b < 3:
        print "####################"

Submission status: WA: Presentation Error

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

n = input()

for i in range(n):
    Inf = map(int, raw_input().split())

    Adr[Inf[0]-1][Inf[1]-1][Inf[2]-1] += Inf[3]

for b in range(4):
    for f in range(3):
        print "",
        for r in range(10):
            if r != 9:
                print Adr[b][f][r],
            if r == 9:
                print Adr[b][f][r]
        print ""

    if b < 3:
        print "####################"

Submission status: WA: Presentation Error

Solution code:
data = [None] * 4
for i in xrange(4):
    data[i] = [None] * 3
    for j in xrange(3):
        data[i][j] = [0] * 10

n = input()
for i in xrange(n):
    line = map(int, raw_input().split())
    data[line[0] - 1][line[1] - 1][line[2] - 1] += line[3]

for i in xrange(4):
    for j in xrange(3):
        s = ""
        for k in xrange(9):
            s += str(data[i][j][k])
            s += ' '
        s += str(data[i][j][9])
        print s
    if i < 3:
        print '#' * 20

Submission status: WA: Presentation Error

Solution code:
n = int(raw_input())
l = [[[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())
    l[b-1][f-1][r-1] += v
for i in range(4):
    if i != 0:
        print "####################" ,
        print ""
    for j in range(3):
        print "",
        for k in range(10):
            print "%d" %l[i][j][k] ,
        print ""

Submission status: WA: Presentation Error

Solution code:
n = int(raw_input())
l = [[[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())
    l[b-1][f-1][r-1] += v
for i in range(4):
    if i != 0:
        print "####################" ,
        print ""
    for j in range(3):
        print "",
        for k in range(9):
            print "%d" %l[i][j][k] ,
        print l[i][j][9]

Submission status: WA: Presentation Error

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

n = input()

A = []
for i in range(n):
    A.append(raw_input().split())

buil1 = [[0 for i in range(10)] for j in range(3)]
buil2 = [[0 for i in range(10)] for j in range(3)]
buil3 = [[0 for i in range(10)] for j in range(3)]
buil4 = [[0 for i in range(10)] for j in range(3)]

b = []
f = []
r = []
v = []

for i in range(n):
    b.append(int(A[i][0]))
    f.append(int(A[i][1]))
    r.append(int(A[i][2]))
    v.append(int(A[i][3]))
for i in range(n) :   
    if b[i] == 1:
         buil1[f[i]-1][r[i]-1] += v[i]
    elif b[i] == 2:
         buil2[f[i]-1][r[i]-1] += v[i]
    elif b[i] == 3:
         buil3[f[i]-1][r[i]-1] += v[i]
    elif b[i] == 4:
         buil4[f[i]-1][r[i]-1] += v[i]

                    
                        
for i in range(3):
    for j in range(10):
        print buil1[i][j],
    print""
    
print"#"*20
for i in range(3):
    for j in range(10):
        print buil2[i][j],
    print""
    
print"#"*20    
for i in range(3):
    for j in range(10):
        print buil3[i][j],
    print""
    
print"#"*20    
for i in range(3):
    for j in range(10):
        print buil4[i][j],
    print""

Submission status: WA: Presentation Error

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

n = input()

A = []
for i in range(n):
    A.append(raw_input().split())

buil1 = [[0 for i in range(10)] for j in range(3)]
buil2 = [[0 for i in range(10)] for j in range(3)]
buil3 = [[0 for i in range(10)] for j in range(3)]
buil4 = [[0 for i in range(10)] for j in range(3)]

b = []
f = []
r = []
v = []

for i in range(n):
    b.append(int(A[i][0]))
    f.append(int(A[i][1]))
    r.append(int(A[i][2]))
    v.append(int(A[i][3]))
for i in range(n) :   
    if b[i] == 1:
         buil1[f[i]-1][r[i]-1] += v[i]
    elif b[i] == 2:
         buil2[f[i]-1][r[i]-1] += v[i]
    elif b[i] == 3:
         buil3[f[i]-1][r[i]-1] += v[i]
    elif b[i] == 4:
         buil4[f[i]-1][r[i]-1] += v[i]

                    
                        
for i in range(3):
    print"",
    for j in range(10):
        print buil1[i][j],
    print""
    
print"#"*20
for i in range(3):
    print"",
    for j in range(10):
        print buil2[i][j],
    print""
    
print"#"*20    
for i in range(3):
    print"",
    for j in range(10):
        print buil3[i][j],
    print""
    
print"#"*20    
for i in range(3):
    print"",
    for j in range(10):
        print buil4[i][j],
    print""

Submission status: WA: Presentation Error

Solution code:
ryou = [0]*4
for i in range(4):
    ryou[i] = [0]*3
for i in range(4):
    for j in range(3):
        ryou[i][j] = [0]*10
sep = '#' * 20

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

for i in range(4):
    for j in range(3):
        s = ' '.join(map(str,ryou[i][j]))
        print(s)
    if not i == 3:
        print(sep)

Submission status: WA: Presentation Error

Solution code:
import sys
n = int(raw_input())

building_a = [[0 for j in range(11)] for i in range(4)]
building_b = [[0 for j in range(11)] for i in range(4)]
building_c = [[0 for j in range(11)] for i in range(4)]
building_d = [[0 for j in range(11)] for i in range(4)]

for i in range(n):
    b, f, r, v = map(int, raw_input().split())
    if b == 1:
        building_a[f][r] += v
    elif b == 2:
        building_b[f][r] += v
    elif b == 3:
        building_c[f][r] += v
    elif b == 4:
        building_d[f][r] += v
        
for i in range(1, 4):
    for j in range(1, 11):
        print building_a[i][j],
    print 
for i in range(20):
    sys.stdout.write("#")
print

for i in range(1, 4):
    for j in range(1, 11):
        print building_b[i][j],
    print 
for i in range(20):
    sys.stdout.write ("#")
print

for i in range(1, 4):
    for j in range(1, 11):
        print building_c[i][j],
    print 
for i in range(20):
    sys.stdout.write("#")
print

for i in range(1, 4):
    for j in range(1, 11):
        print building_d[i][j],
    print

Submission status: WA: Presentation Error

Solution code:


k1 = [[0 for i in xrange(10)] for j in xrange(3)]
k2 = [[0 for i in xrange(10)] for j in xrange(3)]
k3 = [[0 for i in xrange(10)] for j in xrange(3)]
k4 = [[0 for i in xrange(10)] for j in xrange(3)]

n = input()
for i in xrange(n):
    m = map(int,raw_input().split())
    if m[0] == 1:
     k1[m[1]-1][m[2]-1] = k1[m[1]-1][m[2]-1] + m[3] 
    elif m[0] == 2:
     k2[m[1]-1][m[2]-1] = k2[m[1]-1][m[2]-1] + m[3]         
    elif m[0] == 3:
     k3[m[1]-1][m[2]-1] = k3[m[1]-1][m[2]-1] + m[3]         
    elif m[0] == 4:
     k4[m[1]-1][m[2]-1] = k4[m[1]-1][m[2]-1] + m[3] 


for i in xrange(3):
    for j in xrange(10):
        print k1[i][j],
    if j == 9:
        print ""
        
print"####################"

for i in xrange(3):
    for j in xrange(10):
        print k2[i][j],
    if j == 9:
        print ""

print"####################"        

for i in xrange(3):
    for j in xrange(10):
        print k3[i][j],
    if j == 9:
        print ""
        
print"####################"

for i in xrange(3):
    for j in xrange(10):
        print k4[i][j],
    if j == 9:
        print ""

Submission status: WA: Presentation Error

Solution code:


k1 = [[0 for i in xrange(10)] for j in xrange(3)]
k2 = [[0 for i in xrange(10)] for j in xrange(3)]
k3 = [[0 for i in xrange(10)] for j in xrange(3)]
k4 = [[0 for i in xrange(10)] for j in xrange(3)]

n = input()
for i in xrange(n):
    m = map(int,raw_input().split())
    if m[0] == 1:
     k1[m[1]-1][m[2]-1] = k1[m[1]-1][m[2]-1] + m[3] 
    elif m[0] == 2:
     k2[m[1]-1][m[2]-1] = k2[m[1]-1][m[2]-1] + m[3]         
    elif m[0] == 3:
     k3[m[1]-1][m[2]-1] = k3[m[1]-1][m[2]-1] + m[3]         
    elif m[0] == 4:
     k4[m[1]-1][m[2]-1] = k4[m[1]-1][m[2]-1] + m[3] 


for i in xrange(3):
    for j in xrange(10):
        print k1[i][j],
    if j == 9:
        print ""
        
print "####################"

for i in xrange(3):
    for j in xrange(10):
        print k2[i][j],
    if j == 9:
        print ""

print "####################"        

for i in xrange(3):
    for j in xrange(10):
        print k3[i][j],
    if j == 9:
        print ""
        
print "####################"

for i in xrange(3):
    for j in xrange(10):
        print k4[i][j],
    if j == 9:
        print ""

Submission status: WA: Presentation Error

Solution code:


k1 = [[0 for i in xrange(10)] for j in xrange(3)]
k2 = [[0 for i in xrange(10)] for j in xrange(3)]
k3 = [[0 for i in xrange(10)] for j in xrange(3)]
k4 = [[0 for i in xrange(10)] for j in xrange(3)]

n = input()
for i in xrange(n):
    m = map(int,raw_input().split())
    if m[0] == 1:
     k1[m[1]-1][m[2]-1] = k1[m[1]-1][m[2]-1] + m[3] 
    elif m[0] == 2:
     k2[m[1]-1][m[2]-1] = k2[m[1]-1][m[2]-1] + m[3]         
    elif m[0] == 3:
     k3[m[1]-1][m[2]-1] = k3[m[1]-1][m[2]-1] + m[3]         
    elif m[0] == 4:
     k4[m[1]-1][m[2]-1] = k4[m[1]-1][m[2]-1] + m[3] 


for i in xrange(3):
    for j in xrange(10):
        print k1[i][j],
    if j == 9:
        print ""

print"#"*20 

for i in xrange(3):
    for j in xrange(10):
        print k2[i][j],
    if j == 9:
        print ""

print"#"*20        

for i in xrange(3):
    for j in xrange(10):
        print k3[i][j],
    if j == 9:
        print ""
        
print"#"*20 

for i in xrange(3):
    for j in xrange(10):
        print k4[i][j],
    if j == 9:
        print ""

Submission status: WA: Presentation Error

Solution code:
bilt1 = [0] * 30
bilt2 = [0] * 30
bilt3 = [0] * 30
bilt4 = [0] * 30

sha = "#" * 20
count = 0;

x = input()
for i in range(x):
    b,f,r,v =map(int, raw_input().split())
    if b == 1:
        bilt1[((f - 1) * 10) + (r - 1)] = bilt1[((f - 1) * 10) + (r - 1)] + v
    elif b == 2:
        bilt2[((f - 1) * 10) + (r - 1)] = bilt2[((f - 1) * 10) + (r - 1)] + v
    elif b == 3:
        bilt3[((f - 1) * 10) + (r - 1)] = bilt3[((f - 1) * 10) + (r - 1)] + v
    else:
        bilt4[((f - 1) * 10) + (r - 1)] = bilt4[((f - 1) * 10) + (r - 1)] + v

for i in range(3):
    print " " + str(bilt1[i * 10]),
    for j in range(9):
        print bilt1[(i * 10) + (j + 1)],
    print ""
print sha

for i in range(3):
    print " " + str(bilt1[i * 10]),
    for j in range(9):
        print bilt2[(i * 10) + (j + 1)],
    print ""
print sha

for i in range(3):
    print " " + str(bilt1[i * 10]),
    for j in range(9):
        print bilt3[(i * 10) + (j + 1)],
    print ""
print sha

for i in range(3):
    print " " + str(bilt1[i * 10]),
    for j in range(9):
        print bilt4[(i * 10) + (j + 1)],
    print ""

Submission status: WA: Presentation Error

Solution code:
#coding: UTF-8

n = input()

a = 0
aa = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
ab = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
ac = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
ba = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
bb = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
bc = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
ca = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
cb = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
cc = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
da = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
db = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
dc = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]

while a < n:
	l = map(int, raw_input().split())
	b = l[0]
	f = l[1]
	r = l[2]
	v = l[3]
	a += 1
	if b == 1 and f == 1:
		x = aa[r-1]
		y = x + v
		aa[r-1] = y
	if b == 1 and f == 2:
		x = ab[r-1]
		y = x + v
		ab[r-1] = y
	if b == 1 and f == 3:
		x = ac[r-1]
		y = x + v
		ac[r-1] = y
	if b == 2 and f == 1:
		x = ba[r-1]
		y = x + v
		ba[r-1] = y
	if b == 2 and f == 2:
		x = bb[r-1]
		y = x + v
		bb[r-1] = y
	if b == 2 and f == 3:
		x = bc[r-1]
		y = x + v
		bc[r-1] = y
	if b == 3 and f == 1:
		x = ca[r-1]
		y = x + y
		ca[r-1] = y
	if b == 3 and f == 2:
		x = cb[r-1]
		y = x + v
		cb[r-1] = y
	if b == 3 and f == 3:
		x = cc[r-1]
		y = x + v
		cc[r-1] = y
	if b == 4 and f == 1:
		x = da[r-1]
		y = x + y
		da[r-1] = y
	if b == 4 and f == 2:
		x = db[r-1]
		y = x + v
		db[r-1] = y
	if b == 4 and f == 3:
		x = dc[r-1]
		y = x + v
		dc[r-1] = y
print " ",
for aaa in aa:
	print aaa,
print "\n ",
for aba in ab:
	print aba,
print "\n ",
for aca in ac:
	print aca,
print "\n",
print "####################"
print " ",
for baa in ba:
	print baa,
print "\n ",
for bba in bb:
	print bba,
print "\n ",
for bca in bc:
	print bca,
print "\n",
print "####################"
print " ",
for caa in ca:
	print caa,
print "\n ",
for cba in cb:
	print cba,
print "\n ",
for cca in cc:
	print cca,
print "\n",
print "####################"
print " ",
for daa in da:
	print daa,
print "\n ",
for dba in db:
	print dba,
print "\n ",
for dca in dc:
	print dca,







#print "%d %d %d" %(f, s, t)

Submission status: WA: Presentation Error

Solution code:
#coding: UTF-8

n = input()

a = 0
aa = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
ab = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
ac = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
ba = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
bb = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
bc = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
ca = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
cb = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
cc = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
da = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
db = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
dc = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]

while a < n:
	l = map(int, raw_input().split())
	b = l[0]
	f = l[1]
	r = l[2]
	v = l[3]
	a += 1
	if b == 1 and f == 1:
		x = aa[r-1]
		y = x + v
		aa[r-1] = y
	if b == 1 and f == 2:
		x = ab[r-1]
		y = x + v
		ab[r-1] = y
	if b == 1 and f == 3:
		x = ac[r-1]
		y = x + v
		ac[r-1] = y
	if b == 2 and f == 1:
		x = ba[r-1]
		y = x + v
		ba[r-1] = y
	if b == 2 and f == 2:
		x = bb[r-1]
		y = x + v
		bb[r-1] = y
	if b == 2 and f == 3:
		x = bc[r-1]
		y = x + v
		bc[r-1] = y
	if b == 3 and f == 1:
		x = ca[r-1]
		y = x + y
		ca[r-1] = y
	if b == 3 and f == 2:
		x = cb[r-1]
		y = x + v
		cb[r-1] = y
	if b == 3 and f == 3:
		x = cc[r-1]
		y = x + v
		cc[r-1] = y
	if b == 4 and f == 1:
		x = da[r-1]
		y = x + y
		da[r-1] = y
	if b == 4 and f == 2:
		x = db[r-1]
		y = x + v
		db[r-1] = y
	if b == 4 and f == 3:
		x = dc[r-1]
		y = x + v
		dc[r-1] = y
print " ",
for aaa in aa:
	print aaa,
print "\n ",
for aba in ab:
	print aba,
print "\n ",
for aca in ac:
	print aca,
print "\n",
print " ####################"
print " ",
for baa in ba:
	print baa,
print "\n ",
for bba in bb:
	print bba,
print "\n ",
for bca in bc:
	print bca,
print "\n",
print " ####################"
print " ",
for caa in ca:
	print caa,
print "\n ",
for cba in cb:
	print cba,
print "\n ",
for cca in cc:
	print cca,
print "\n",
print " ####################"
print " ",
for daa in da:
	print daa,
print "\n ",
for dba in db:
	print dba,
print "\n ",
for dca in dc:
	print dca,







#print "%d %d %d" %(f, s, t)

Submission status: WA: Presentation Error

Solution code:
#coding: UTF-8

n = input()

a = 0
aa = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
ab = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
ac = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
ba = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
bb = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
bc = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
ca = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
cb = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
cc = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
da = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
db = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
dc = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]

while a < n:
	l = map(int, raw_input().split())
	b = l[0]
	f = l[1]
	r = l[2]
	v = l[3]
	a += 1
	if b == 1 and f == 1:
		x = aa[r-1]
		y = x + v
		aa[r-1] = y
	if b == 1 and f == 2:
		x = ab[r-1]
		y = x + v
		ab[r-1] = y
	if b == 1 and f == 3:
		x = ac[r-1]
		y = x + v
		ac[r-1] = y
	if b == 2 and f == 1:
		x = ba[r-1]
		y = x + v
		ba[r-1] = y
	if b == 2 and f == 2:
		x = bb[r-1]
		y = x + v
		bb[r-1] = y
	if b == 2 and f == 3:
		x = bc[r-1]
		y = x + v
		bc[r-1] = y
	if b == 3 and f == 1:
		x = ca[r-1]
		y = x + y
		ca[r-1] = y
	if b == 3 and f == 2:
		x = cb[r-1]
		y = x + v
		cb[r-1] = y
	if b == 3 and f == 3:
		x = cc[r-1]
		y = x + v
		cc[r-1] = y
	if b == 4 and f == 1:
		x = da[r-1]
		y = x + y
		da[r-1] = y
	if b == 4 and f == 2:
		x = db[r-1]
		y = x + v
		db[r-1] = y
	if b == 4 and f == 3:
		x = dc[r-1]
		y = x + v
		dc[r-1] = y
print " " + str(aa[0]),
aaa = 1
while aaa < 10:
	print str(aa[aaa]),
	aaa += 1
print "\n " + str(ab[0]),
aba = 1
while aba < 10:
	print str(ab[aba]),
	aba += 1
print "\n " + str(ac[0]),
aca = 1
while aca < 10:
	print str(ac[aca]),
	aca += 1

print "\n",
print "####################"
print " " + str(ba[0]),
baa = 1
while baa < 10:
	print str(ba[baa]),
	baa += 1
print "\n " + str(bb[0]),
bba = 1
while bba < 10:
	print str(bb[bba]),
	bba += 1
print "\n " + str(bc[0]),
bca = 1
while bca < 10:
	print str(bc[bca]),
	bca += 1
print "\n",
print "####################"

print " " + str(ca[0]),
caa = 1
while caa < 10:
	print str(ca[caa]),
	caa += 1
print "\n " + str(cb[0]),
cba = 1
while cba < 10:
	print str(cb[cba]),
	cba += 1
print "\n " + str(cc[0]),
cca = 1
while cca < 10:
	print str(cc[cca]),
	cca += 1
print "\n",
print "####################"
print " " + str(da[0]),
daa = 1
while daa < 10:
	print str(da[daa]),
	daa += 1
print "\n " + str(db[0]),
dba = 1
while dba < 10:
	print str(db[dba]),
	dba += 1
print "\n " + str(dc[0]),
dca = 1
while dca < 10:
	print str(dc[dca]),
	dca += 1




#print "%d %d %d" %(f, s, t)

Submission status: WA: Presentation Error

Solution code:
import sys
n = int(input())

A=[[['0' for _ in range(10)] for _ in range(3)] for _ in range(4)]
#0??§?????????
#[[[0 0 0 0 0 0 0 0 0 0],
#  [0 0 0 0 0 0 0 0 0 0],
#  [0 0 0 0 0 0 0 0 0 0]],
# [[0 0 0 0 0 0 0 0 0 0],
#  [0 0 0 0 0 0 0 0 0 0],
#  [0 0 0 0 0 0 0 0 0 0]],
# [[0 0 0 0 0 0 0 0 0 0],  
#  [0 0 0 0 0 0 0 0 0 0],
#  [0 0 0 0 0 0 0 0 0 0]],
# [[0 0 0 0 0 0 0 0 0 0],
#  [0 0 0 0 0 0 0 0 0 0],
#  [0 0 0 0 0 0 0 0 0 0]]]

#?£?    Building = b
#???    Floor    = f
#???    Room     = r
#??°    Number   = num
for i in range(n):
	b,f,r,num = input().strip().split()
	A[int(b)-1][int(f)-1][int(r)-1]=num

for i in range(4):
	for j in range(3):
		sys.stdout.write(' ')
		sys.stdout.write(' '.join(A[i][j]))
		#sys.stdout.write(' ')
		print()
	if i!=3:print('#'*20)
print()

Submission status: WA: Presentation Error

Solution code:
import sys
n = int(input())

A=[[['0' for _ in range(10)] for _ in range(3)] for _ in range(4)]
#0??§?????????
#[[[0 0 0 0 0 0 0 0 0 0],
#  [0 0 0 0 0 0 0 0 0 0],
#  [0 0 0 0 0 0 0 0 0 0]],
# [[0 0 0 0 0 0 0 0 0 0],
#  [0 0 0 0 0 0 0 0 0 0],
#  [0 0 0 0 0 0 0 0 0 0]],
# [[0 0 0 0 0 0 0 0 0 0],  
#  [0 0 0 0 0 0 0 0 0 0],
#  [0 0 0 0 0 0 0 0 0 0]],
# [[0 0 0 0 0 0 0 0 0 0],
#  [0 0 0 0 0 0 0 0 0 0],
#  [0 0 0 0 0 0 0 0 0 0]]]

#?£?    Building = b
#???    Floor    = f
#???    Room     = r
#??°    Number   = num
for i in range(n):
	b,f,r,num = input().strip().split()
	A[int(b)-1][int(f)-1][int(r)-1]=num

for i in range(4):
	for j in range(3):
		sys.stdout.write(' ')
		sys.stdout.write(' '.join(A[i][j]))
		sys.stdout.write(' ')
		print()
	if i!=3:
		print('#'*20)
print()

Submission status: WA: Presentation Error

Solution code:
import sys
n = int(input())

A=[[['0' for _ in range(10)] for _ in range(3)] for _ in range(4)]
#0??§?????????
#[[[0 0 0 0 0 0 0 0 0 0],
#  [0 0 0 0 0 0 0 0 0 0],
#  [0 0 0 0 0 0 0 0 0 0]],
# [[0 0 0 0 0 0 0 0 0 0],
#  [0 0 0 0 0 0 0 0 0 0],
#  [0 0 0 0 0 0 0 0 0 0]],
# [[0 0 0 0 0 0 0 0 0 0],  
#  [0 0 0 0 0 0 0 0 0 0],
#  [0 0 0 0 0 0 0 0 0 0]],
# [[0 0 0 0 0 0 0 0 0 0],
#  [0 0 0 0 0 0 0 0 0 0],
#  [0 0 0 0 0 0 0 0 0 0]]]

#?£?    Building = b
#???    Floor    = f
#???    Room     = r
#??°    Number   = num
for i in range(n):
	b,f,r,num = input().strip().split()
	A[int(b)-1][int(f)-1][int(r)-1]=num

for i in range(4):
	for j in range(3):
		sys.stdout.write(' ')
		sys.stdout.write(' '.join(A[i][j]))
		print()
	if i!=3:
		print('#'*20)
print()

Submission status: WA: Presentation Error

Solution code:
import sys
n = int(input())

A=[[['0' for _ in range(10)] for _ in range(3)] for _ in range(4)]
#0??§?????????
#[[[0 0 0 0 0 0 0 0 0 0],
#  [0 0 0 0 0 0 0 0 0 0],
#  [0 0 0 0 0 0 0 0 0 0]],
# [[0 0 0 0 0 0 0 0 0 0],
#  [0 0 0 0 0 0 0 0 0 0],
#  [0 0 0 0 0 0 0 0 0 0]],
# [[0 0 0 0 0 0 0 0 0 0],  
#  [0 0 0 0 0 0 0 0 0 0],
#  [0 0 0 0 0 0 0 0 0 0]],
# [[0 0 0 0 0 0 0 0 0 0],
#  [0 0 0 0 0 0 0 0 0 0],
#  [0 0 0 0 0 0 0 0 0 0]]]

#?£?    Building = b
#???    Floor    = f
#???    Room     = r
#??°    Number   = num
for i in range(n):
	b,f,r,num = input().strip().split()
	A[int(b)-1][int(f)-1][int(r)-1]=num

for i in range(4):
	for j in range(3):
		sys.stdout.write(' ')
		sys.stdout.write(' '.join(A[i][j]))
		sys.stdout.write(' ')
		print()
	if i!=3:
		print('#'*20)

Submission status: WA: Presentation Error

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

n = input()

for i in xrange(n):
    b,f,r,v=map(int,raw_input().split())
    house_info[b-1][f-1][r-1] = v
    
for i in xrange(4):
    for j in xrange(3):
        result = " ".join(map(str,house_info[i][j]))
        print result
    if i < 3:
        print "####################"

Submission status: WA: Presentation Error

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

dic = {}
bui = [k for k in range(1, 5)]
flo = [k for k in range(1, 4)]
roo = [k for k in range(1, 11)]

for b in bui:
    for f in flo:
        for r in roo:
            dic[(b, f, r)] = 0

n = input()
for i in range(n):
    list = map(int, raw_input().split())
    b = list[0]
    f = list[1]
    r = list[2]
    dic[(b, f, r)] += list[3]

for b in bui:
    for f in flo:
        for r in roo:
            print dic[(b, f, r)],
        print ""
    if b < 4:
        print "#"*20

Submission status: WA: Presentation Error

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

dic = {}
bui = [k for k in range(1, 5)]
flo = [k for k in range(1, 4)]
roo = [k for k in range(1, 11)]

for b in bui:
    for f in flo:
        for r in roo:
            dic[(b, f, r)] = 0

n = input()
for i in range(n):
    list = map(int, raw_input().split())
    b = list[0]
    f = list[1]
    r = list[2]
    dic[(b, f, r)] += list[3]

for b in bui:
    for f in flo:
        print "",
        for r in roo:
            print dic[(b, f, r)],
        print ""
    if b < 4:
        print "#"*20

Submission status: WA: Presentation Error

Solution code:

def inkousha(w_list, x, y, z):
    w_list[x-1][y-1] += z
    
def answerp(w_list):

    for i in range(3):
        print (" "),
        for j in range(10):
            print w_list[i][j],
        print("")
        

n = input()

A1 = [[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0]]
A2 = [[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0]]
A3 = [[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0]]
A4 = [[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0]]

for i in range(n):
    x = raw_input()
    b, f, r, v = x.split()
    b = int(b)
    f = int(f)
    r = int(r)
    v = int(v)
    
    if b == 1:
        inkousha(A1, f, r, v)
    elif b == 2:
        inkousha(A2, f, r, v)
    elif b == 3:
        inkousha(A3, f, r, v)
    else:
        inkousha(A4, f, r, v)
    
answerp(A1)
print("####################")
answerp(A2)
print("####################")
answerp(A3)
print("####################")
answerp(A4)

Submission status: WA: Presentation Error

Solution code:

def inkousha(w_list, x, y, z):
    w_list[x-1][y-1] += z
    
def answerp(w_list):

    for i in range(3):
        print (""),
        for j in range(10):
            print w_list[i][j],
        print("")
        

n = input()

A1 = [[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0]]
A2 = [[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0]]
A3 = [[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0]]
A4 = [[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0]]

for i in range(n):
    x = raw_input()
    b, f, r, v = x.split()
    b = int(b)
    f = int(f)
    r = int(r)
    v = int(v)
    
    if b == 1:
        inkousha(A1, f, r, v)
    elif b == 2:
        inkousha(A2, f, r, v)
    elif b == 3:
        inkousha(A3, f, r, v)
    else:
        inkousha(A4, f, r, v)
    
answerp(A1)
print("####################")
answerp(A2)
print("####################")
answerp(A3)
print("####################")
answerp(A4)

Submission status: WA: Presentation Error

Solution code:

def inkousha(w_list, x, y, z):
    w_list[x-1][y-1] += z
    
def answerp(w_list):

    for i in range(3):
        print(""),
        for j in range(10):
            print w_list[i][j],
        print("")
        

n = input()

A1 = [[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0]]
A2 = [[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0]]
A3 = [[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0]]
A4 = [[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0]]

for i in range(n):
    x = raw_input()
    b, f, r, v = x.split()
    b = int(b)
    f = int(f)
    r = int(r)
    v = int(v)
    
    if b == 1:
        inkousha(A1, f, r, v)
    elif b == 2:
        inkousha(A2, f, r, v)
    elif b == 3:
        inkousha(A3, f, r, v)
    else:
        inkousha(A4, f, r, v)
    
answerp(A1)
print("####################")
answerp(A2)
print("####################")
answerp(A3)
print("####################")
answerp(A4)

Submission status: WA: Presentation Error

Solution code:
n = input()
arr = [map(int,raw_input().split()) for _ in range(n)]

tou = [[[0 for i in range(10)] for j in range(3)] for k in range(4)]

for line in arr:
    b,f,r,v = line
    tou[b-1][f-1][r-1] = tou[b-1][f-1][r-1] + v

for i in range(4):
    for j in range(3):
        print ' '.join(map(str,tou[i][j]))
    if i < 3 :
        print '#'*20

Submission status: WA: Presentation Error

Solution code:

def check(x_list, f, r, v):
    x_list[f][r] += v

def peo(x_list):
    for i in range(3):
        print(""),
        for j in range(10):
            print x_list[i][j],
        print ("")

A_bill = [[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0]]
B_bill = [[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0]]
C_bill = [[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0]]
D_bill = [[0,0,0,0,0,0,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):
    x = raw_input()
    b, f, r, v = x.split()
    b = int(b)
    f = int(f)
    r = int(r)
    v = int(v)
    
    if b == 1:
        check(A_bill, f-1,r-1,v)
    elif b == 2:
        check(B_bill, f-1,r-1,v)
    elif b == 3:
        check(C_bill, f-1,r-1,v)
    elif b == 4:
        check(D_bill, f-1,r-1,v)

peo(A_bill)
print("####################")
peo(B_bill)
print("####################")
peo(C_bill)
print("####################")
peo(D_bill)

Submission status: WA: Presentation Error

Solution code:

import sys

def check(x_list, f, r, v):
    x_list[f][r] += v

def peo(x_list):
    for i in range(3):
        for j in range(10):
            print (""),
            sys.stdout.write("%d" %(x_list[i][j]))
        print ("")

A_bill = [[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0]]
B_bill = [[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0]]
C_bill = [[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0]]
D_bill = [[0,0,0,0,0,0,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):
    x = raw_input()
    b, f, r, v = x.split()
    b = int(b)
    f = int(f)
    r = int(r)
    v = int(v)
    
    if b == 1:
        check(A_bill, f-1,r-1,v)
    elif b == 2:
        check(B_bill, f-1,r-1,v)
    elif b == 3:
        check(C_bill, f-1,r-1,v)
    elif b == 4:
        check(D_bill, f-1,r-1,v)

peo(A_bill)
print("####################")
peo(B_bill)
print("####################")
peo(C_bill)
print("####################")
peo(D_bill)

Submission status: WA: Presentation Error

Solution code:
# -*- coding: utf-8 -*-
n = int(input())
Univ = [[[0 for i in range(10)]for j in range(3)]for k in range(4)]
for i in range(n):
    b,f,r,v =[int(i)for i in input().split(' ')]
    Univ[b-1][f-1][r-1] += v

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