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:
def Input(b, f, rn, h):
    A[b][f][rn] += h

def Output():
    for b in range(4):
        for f in range(4):
            for rn in range(10):
                if b == 3 and f == 3:
                    break
                if f < 3:
                    print(' ' + str(A[b][f][rn]), end = '')
                else:
                    print('##', end = '')
            print()

n = int(input())

A = [[[0 for rn in range(10)] for f in range(3)] for b in range(4)]

for idx in range(n):
    R = input().split()
    B = int(R[0]) - 1
    F = int(R[1]) - 1
    RN = int(R[2]) - 1
    H = int(R[3])
    Input(B, F, RN, H)
Output()
print()

Submission status: WA: Presentation Error

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

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

Submission status: WA: Presentation Error

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

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

k = 0
for i in range(4):
    for j in range(3):
        print(*table[i][j])
    if k < 3:
        print("####################")
        k += 1

Submission status: WA: Presentation Error

Solution code:
from collections import OrderedDict
from itertools import cycle, islice
 
d = OrderedDict(("{} {} {}".format(b, f, r), 0) for b in range(1, 5)
                                                for f in range(1, 4)
                                                for r in range(1, 11))
 
n = int(input())
for _ in range(n):
    s = input()
    idx = s.rfind(" ")
    d[s[:idx]] += int(s[idx+1:])

data = d.values()
delim = "#" * 20
for i in range(0, 120, 10):
    print(" ".join(map(str, islice(cycle(data), i, i+10))))
    if i in (20, 50, 80):
        print(delim)

Submission status: WA: Presentation Error

Solution code:
building = []

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

n = int(input())

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

for i in range(4):
    if i >= 1:
        print("####################")
    for j in range(3):
        for k in range(10):
            print(building[i][j][k],end=" ")
        print()

Submission status: WA: Presentation Error

Solution code:
import sys
write=sys.stdout.write

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

informations=int(input())

for i in range(0,informations):
    information=[]
    information=input().split()
    information[0]=int(information[0])
    information[1]=int(information[1])
    information[2]=int(information[2])
    information[3]=int(information[3])
    buildings[information[0]-1][information[1]-1][information[2]-1]+=information[3]

for i in range(0,4):
    for j in range(0,3):
        for k in range(0,10):
            write(str(buildings[i][j][k]))
            write(' ')
        print()
    if i !=3:
        for j in range(0,20):
            write('#')
        print()

Submission status: WA: Presentation Error

Solution code:
lst = [[[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,raw_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):
        pri = ""
        for k in range(10):
            pri += str(lst[i][j][k])
        print pri

Submission status: WA: Presentation Error

Solution code:
lst = [[[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,raw_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):
        pri = ""
        for k in range(10):
            pri += str(lst[i][j][k])
        print " "+ pri

Submission status: WA: Presentation Error

Solution code:
lst = [[[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,raw_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):
        pri = ""
        for k in range(10):
            pri += str(lst[i][j][k])
        print " "+ pri

Submission status: WA: Presentation Error

Solution code:
lst = [[[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,raw_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):
        pri = ""
        for k in range(10):
            pri += " "+ str(lst[i][j][k])
        print " " + pri

Submission status: WA: Presentation Error

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

Submission status: WA: Presentation Error

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

Submission status: WA: Presentation Error

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

Submission status: WA: Presentation Error

Solution code:
n = int(raw_input())

info = [[[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())
    b, f, r = b-1, f-1, r-1
    info[b][f][r] += v

sharp = False
for i in info:
    if sharp:
        print "#" * 20
    for j in i:
        print " ".join(map(str, j))
    sharp = True

Submission status: WA: Presentation Error

Solution code:
x = {}
for i in range(4):
    for j in range(3):
        for k in range(10):
            i,j,k = str(i), str(j), str(k)
            x[i+j+k] = 0

n = int(input())
for i in range(n):
    i,j,k,l = map(int, input().split())
    key = str(i-1)+str(j-1)+str(k-1)
    x[key] = x[key] + int(l)

for i in range(4):
    for j in range(3):
        for k in range(10):
            i,j,k = str(i), str(j), str(k)
            if k != "9":
                print(x[i+j+k], end=' ')
            else:
                print(x[i+j+k])
    if int(i) + 1 < 4:
        print("#"*20)

Submission status: WA: Presentation Error

Solution code:
x = {}
for i in range(4):
    for j in range(3):
        for k in range(10):
            i,j,k = str(i), str(j), str(k)
            x[i+j+k] = 0

n = int(input())
for i in range(n):
    i,j,k,l = map(int, input().split())
    key = str(i-1)+str(j-1)+str(k-1)
    x[key] = x[key] + int(l)

for i in range(4):
    for j in range(3):
        for k in range(10):
            i,j,k = str(i), str(j), str(k)
            if k != "9":
                print(x[i+j+k], end=' ')
            else:
                print(x[i+j+k])
    if int(i) + 1 < 4:
        print("#"*20)
print()

Submission status: WA: Presentation Error

Solution code:
x = {}
for i in range(4):
    for j in range(3):
        for k in range(10):
            i,j,k = str(i), str(j), str(k)
            x[i+j+k] = 0

n = int(input())
for i in range(n):
    i,j,k,l = map(int, input().split())
    key = str(i-1)+str(j-1)+str(k-1)
    x[key] = x[key] + int(l)

for i in range(4):
    for j in range(3):
        for k in range(10):
            i,j,k = str(i), str(j), str(k)
            if k != "9":
                print(str(x[i+j+k]), end=' ')
            else:
                print(x[i+j+k])
    if int(i) + 1 < 4:
        print("#"*20)

Submission status: WA: Presentation Error

Solution code:
room = [0 for i in range(120)]
c = int(input())
for i in range(c):
    b, f, r, v = [int(s) for s in input().split()]
    index = (30 * (b - 1)) + (10 * (f - 1)) + (r - 1)
    room[index] += v

for i in range(12):
    if (i != 0) and (i % 3 == 0):
        print('#' * 20)
    print(' '.join([str(v) for v in room[i*10:i*10+10]]))

Submission status: WA: Presentation Error

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

for i in range(n):
    data = [int(j) for j in list(input().split())]
    tower = data[0]-1
    floor = data[1]-1
    room = data[2]-1
    dormitory[tower][floor][room] += data[3]

for i in range(0, 4):
    for j in range(0, 3):
        print(" ".join(map(str, dormitory[i][j])))
    if i == 3:
        break
    else:
        print('#'*20)

Submission status: WA: Presentation Error

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

for i in range(n):
    data = [int(j) for j in list(input().split())]
    tower = data[0]-1
    rank = data[1]-1
    room = data[2]-1
    dormitory[tower][rank][room] += data[3]

for i in range(0, 4):
    for j in range(0, 3):
        print(" ".join(map(str, dormitory[i][j])))
    if i == 3:
        break
    else:
        print('#'*20)

Submission status: WA: Presentation Error

Solution code:
residence=[[[0 for i in range(10)] for j in range(3)] for k in range(4)]
n=int(input())
lines=[input() for i in range(n)]
for l in lines:
    k=list(map(int,l.split()))
    residence[k[0]-1][k[1]-1][k[2]-1]=k[3]
for b in range(4):
    for f in range(3):
        print(' '.join(map(str,residence[b][f])))
    if b!=3: print('#'*20)

Submission status: WA: Presentation Error

Solution code:
n = int(input())

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

for b in range(4):
    for f in range(3):
        print(' '.join(map(str,tenant[b][f])))
    if b < 3:
        print('#'*20)

Submission status: WA: Presentation Error

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

import fileinput
import math

def main():
    offiHouse = [[[0 for i3 in range(10)] for i2 in range(3)] for i1 in range(4)]   #y, x, z

    n = int(input())

    for i in range(n):
        a, b, c, d = map(int, input().split())

        offiHouse[a-1][b-1][c-1] += d

    for i in range(4):
        for j in range(3):
            for k in range(10):
                if(k == 9):
                    print('%d' % offiHouse[i][j][k])
                else:
                    print('%d ' % offiHouse[i][j][k], end='')

        if(i != 3):
            print('####################')

if __name__ == '__main__':
    main()

Submission status: WA: Presentation Error

Solution code:
import sys
n=int(input())
a=[[[0 for i in range(10)] for i in range(3)] for i in range(4)]
for i in range(n):
    w=input().split()
    b=(int(w[0]))
    f=(int(w[1]))
    r=(int(w[2]))
    v=(int(w[3]))
    a[b-1][f-1][r-1]+=v
for i in range(4):
    for j in range(3):
        for k in range(10):
            sys.stdout.write(" {0}".format(a[i][j][k]))
        sys.stdout.write("\n")
    if (i!=3):
        for x in range(20):
            sys.stdout.write("#")
        sys.stdout.write("\n")
sys.stdout.write("\n")

Submission status: WA: Presentation Error

Solution code:
def main():
    n = int(input())
    n_b = 4
    n_f = 3
    n_r = 10

    from collections import defaultdict
    state = defaultdict(int)

    for _ in range(n):
        # b?£?f??????r???????????¨?±?
        # v??????????????§??\?±????????????¨???????????????
        # v?????????????????´??????v????????????????????¨??????????????????
        b, f, r, v = map(int, input().split())
        state[(b, f, r)] += v

    for b in range(1, n_b + 1):
        for f in range(1, n_f + 1):
            room_state = []
            for r in range(1, n_r + 1):
                room_state.append(state[(b, f, r)])
            print(" ".join(map(str, room_state)))
        if b != n_b:
            print("#" * 20)


if __name__ == "__main__":
    main()

Submission status: WA: Presentation Error

Solution code:
n = int(input())
list = [[0 for i in range(10)] for j in range(12)]
for i in range(n):
    b,f,r,v = map(int,input().split())
    list[3*(b - 1)+(f - 1)][r - 1] += v
for i in range(12):
    if i % 3 == 0 and i != 0:
        print('####################')
    for j in range(10):
        print('{}'.format(list[i][j]),end = "")
        if j != 9:
            print(' ',end = "")
        else:
            print('')

Submission status: WA: Presentation Error

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

Submission status: WA: Presentation Error

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

Submission status: WA: Presentation Error

Solution code:
n = int(input())

ab = 4
af = 3
ar = 10

data = [[[0 for i in range(ar)] for j in range(af)] for k in range(ab)]

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

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

for i in range(ab):
    if i != 0:
        print('#' * 20)
    for j in range(af):
        print(*data[i][j])

Submission status: WA: Presentation Error

Solution code:
'''
いちばん簡単なのは建物とフロアごとにリスト作って、足し引き
'''


#部屋、フロア、建物をクラスで定義。まあ、クラスにしなくてもいいんだけど

a = int(input())

n = 10
m = 3
o = 4
h = [
        [
            [0 for i in range(n)] 
         for j in range(m)] 
    for k in range(o)]


#w, x, y, z = 3, 1, 8, 4
for i in range(a):
    w,x,y,z = map(int, input().split())
    h[w-1][x-1][y-1] += z

#print(h[1][1])
#建物と建物仕切り
def makeFence():
    fence = '#' * 20
    print(fence)

#部屋を表示する関数
def showRoom(f):
    for k in range(len(f)-1):
        print(f[k], end=' ')
    print(f[len(f)-1])

#フロアを表示する関数
def showFloor(b):
    j = 0
    while j < len(b):
        f = b[j]
        showRoom(f)
        j += 1

def statusShow(h):
    for i in range(len(h)-1):
        b = h[i]
        showFloor(b)
        makeFence()
    showFloor(h[len(h)-1])

statusShow(h) 

   
#b = statusShow(h)
#makeFence()
#print(b)

Submission status: WA: Presentation Error

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

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

Submission status: WA: Presentation Error

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

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

Submission status: WA: Presentation Error

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

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

Submission status: WA: Presentation Error

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

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

Submission status: WA: Presentation Error

Solution code:
notice = int(input())
record = [[[0] * 10 for i in range(3)] for j in range(4)]

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

ans = ('\n' + '#' * 20 + '\n').join([ '\n'.join([' '.join(map(str, floor)) for floor in building]) for building in record])
print(ans)

Submission status: WA: Presentation Error

Solution code:
#coding: utf-8

n = int(input())

x = [[[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(j) for j in input().split())
    x[b-1][f-1][r-1] += v

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

Submission status: WA: Presentation Error

Solution code:
#coding: utf-8

n = int(input())

x = [[[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(j) for j in input().split())
    x[b-1][f-1][r-1] += v

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

Submission status: WA: Presentation Error

Solution code:
#coding: utf-8

n = int(input())

x = [[[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(j) for j in input().split())
    x[b-1][f-1][r-1] += v

for i in range(4):
    for j in range(3):
        for k in range(10):
            print(" " + str(x[i][j][k]), end = '' if k != 9 else '\n')
    print("#"*20 if i != 3 else '')

Submission status: WA: Presentation Error

Solution code:
#coding: utf-8

n = int(input())

x = [[[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(j) for j in input().split())
    x[b-1][f-1][r-1] += v

for i in range(4):
    for j in range(3):
        for k in range(10):
            print(" " + str(x[i][j][k]), end = '' if k != 9 else '\n')
    print("#"*20 if i != 3 else '\n')

Submission status: WA: Presentation Error

Solution code:
arr = [[[0 for i3 in range(10)] for i2 in range(3)] for i1 in range(4)]
for _ in range(int(input())):
    a,b,c,d = map(int,input().split())
    arr[a-1][b-1][c-1] += d
for j1 in range(4):
    for j2 in range(3):
        u = arr[j1][j2]
        print(u[0],u[1],u[2],u[3],u[4],u[5],u[6],u[7],u[8],u[9])
    if j1 == 3:
        break
    print("####################")

Submission status: WA: Presentation Error

Solution code:
N = int(input())
n = [ map(int, input().split()) for i in range(N) ]
kousya = [ [[0]*10 for i in range(3)] for j in range(4) ]
for b, f, r, v in n:
    kousya[b-1][f-1][r-1] = v
for i in range(4):
    for j in range(3):
        print(*kousya[i][j])
    else:
        if i == 3: break
        print('#' * 20)

Submission status: WA: Presentation Error

Solution code:
n = int(input())
ten = [[[0 for i in range(10)] for j in range(3)] for k in range(4)]
for b in range(4):
    for f in range(3):
        for r in range(10):
            ten[b][f][r] = 0

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

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

Submission status: WA: Presentation Error

Solution code:
n = int(input())
ten = [[[0 for i in range(10)] for j in range(3)] for k in range(4)]
for b in range(4):
    for f in range(3):
        for r in range(10):
            ten[b][f][r] = 0

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

for b in range(4):
    for f in range(3):
        for r in range(10):
            if not r==9:print(ten[b][f][r],end=' ')
            else:print(ten[b][f][r])
    if not b==3:print('#'*20)

Submission status: WA: Presentation Error

Solution code:
import sys

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

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

for value in values:
    nyukyo[value[0]-1][value[1]-1][value[2]-1] = value[3]
    if nyukyo[value[0] - 1][value[1] - 1][value[2] - 1] < 0:
        nyukyo[value[0] - 1][value[1] - 1][value[2] - 1] = 0
    elif nyukyo[value[0]-1][value[1]-1][value[2]-1] > 9:
        nyukyo[value[0] - 1][value[1] - 1][value[2] - 1] = 9

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

Submission status: WA: Presentation Error

Solution code:
import sys

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

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

for value in values:
    nyukyo[value[0]-1][value[1]-1][value[2]-1] = value[3]
    if nyukyo[value[0] - 1][value[1] - 1][value[2] - 1] < 0:
        nyukyo[value[0] - 1][value[1] - 1][value[2] - 1] = 0
    elif nyukyo[value[0]-1][value[1]-1][value[2]-1] > 9:
        nyukyo[value[0] - 1][value[1] - 1][value[2] - 1] = 9

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

Submission status: WA: Presentation Error

Solution code:
import sys

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

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

for value in values:
    nyukyo[value[0]-1][value[1]-1][value[2]-1] += value[3]
    if nyukyo[value[0] - 1][value[1] - 1][value[2] - 1] < 0:
        nyukyo[value[0] - 1][value[1] - 1][value[2] - 1] = 0
    elif nyukyo[value[0]-1][value[1]-1][value[2]-1] > 9:
        nyukyo[value[0] - 1][value[1] - 1][value[2] - 1] = 9

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

Submission status: WA: Presentation Error

Solution code:
n=int(input())
build,story,room,people=[],[],[],[]
for i in range(n):
    date=list(map(int,input().split(' ')))
    build.append(date[0])
    story.append(date[1])
    room.append(date[2])
    people.append(date[3])
build1=[[0 for i in range(10)] for j in range(3)]
build2=[[0 for i in range(10)] for j in range(3)]
build3=[[0 for i in range(10)] for j in range(3)]
build4=[[0 for i in range(10)] for j in range(3)]

for i in range(n):
    m=int(i)
    if(build[m]==1):
        build1[story[m]-1][room[m]-1]=build1[story[m]-1][room[m]-1]+people[m]
    if(build[m]==2):
        build2[story[m]-1][room[m]-1]=build1[story[m]-1][room[m]-1]+people[m]
    if(build[m]==3):
        build3[story[m]-1][room[m]-1]=build1[story[m]-1][room[m]-1]+people[m]
    if(build[m]==4):
        build4[story[m]-1][room[m]-1]=build1[story[m]-1][room[m]-1]+people[m]

for i in range(3):
    print( ' '.join(list(map( lambda x: str(x),build1[i]))) )
print('#'*20)
for i in range(3):
    print( ' '.join(list(map( lambda x: str(x),build2[i]))) )
print('#'*20)
for i in range(3):
    print( ' '.join(list(map( lambda x: str(x),build3[i]))) )
print('#'*20)
for i in range(3):
    print( ' '.join(list(map( lambda x: str(x),build4[i]))) )