Problem:

Official House

You manage 4 buildings, each of which has 3 floors, each of which consists of 10 rooms. Write a program which reads a sequence of tenant/leaver notices, and reports the number of tenants for each room.

  For each notice, you are given four integers b, f, r and v which represent that v persons entered to room r of fth floor at building b. If v is negative, it means that &minus;v persons left.

Assume that initially no person lives in the building. 

Input

  In the first line, the number of notices n is given. In the following n lines, a set of four integers b, f, r and v which represents ith notice is given in a line. 

Output

For each building, print the information of 1st, 2nd and 3rd floor in this order. For each floor information, print the number of tenants of 1st, 2nd, .. and 10th room in this order. Print a single space character before the number of tenants. Print "####################" (20 '#') between buildings.

Constraints

No incorrect building, floor and room numbers are given.

0 ≤ the number of tenants during the management ≤ 9

Sample Input

3
1 1 3 8
3 2 2 7
4 3 8 1

Sample Output

 0 0 8 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
####################
 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
####################
 0 0 0 0 0 0 0 0 0 0
 0 7 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
####################
 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 1 0 0



Sample input:
3
1 1 3 8
3 2 2 7
4 3 8 1


Sample output:
 0 0 8 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
####################
 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
####################
 0 0 0 0 0 0 0 0 0 0
 0 7 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
####################
 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 1 0 0

Submission status: Runtime Error

Solution code:
n= int(input())
tbl=[[[0]*10 for i in range(0,3)] for j in range(0,4)]
for k in range(n):
    b,f,r,v = map(int,input().split())
    tbl[b-1][f-1][r-1] +=v
x=0
for i in range (4):
    if x !=0 : print("#"*20)
    x +=1
    for a in range(3):
        for b in range(10):
            print(" %d%(tbl[i][a][b]),end="")     
        print()

Submission status: Runtime Error

Solution code:
rooms = [[[0 for i in range(10)] for j in range(3)] for k in range(4)]
n = int(input())
for l in range(n):
    a,b,c,d = map(int, input().split())
    rooms[a-1][b-1][c-1] += d
for i in range(4):
    for j in range(3):
        for k in range(10):
            print(rooms[i][j][k], end = "")
            if k != 9:
                print(" ", end="")
        print()
    if i != 3
        print("####################")

Submission status: Runtime Error

Solution code:
table = [0] * 4*3*10

n = int(input())

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

for i in range(120)
    if i % 30:
        print("####################")
    print(table[i], end="")
    if i%10 ==9:
        print()
    else:
        print(" ", end="")

Submission status: Runtime Error

Solution code:
table = [0] * 4*3*10

n = int(input())

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

for i in range(120)
    if i % 30:
        print("####################")
    print(table[i], end="")
    if i%10 ==9:
        print()
    else:
        print(" ", end="")

Submission status: Runtime Error

Solution code:
table = [0] * 4*3*10

n = int(input())

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

for i in range(120):
    if i % 30:
        print("####################")
    print(table[i], end="")
    if i%10 ==9:
        print()
    else:
        print(" ", end="")

Submission status: Runtime Error

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

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

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

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

Submission status: Runtime Error

Solution code:
import numpy as np
n = int(input())
A = np.zeros((4, 3, 10))
for _ in range(n):
    b, f, r, v = map(int, input().split())
    A[b-1, f-1, r-1] = v
for i in A.tolist():
    for v in i:
        v = [str(int(h)) for h in v]
        print(' '.join(v))
    print('####################')

Submission status: Runtime Error

Solution code:
import numpy as np
n = int(input())
A = np.zeros((4, 3, 10))
for _ in range(n):
    b, f, r, v = map(int, input().split())
    A[b-1, f-1, r-1] = v
for i in A:
    for v in i:
        v = [str(int(h)) for h in v]
        print(' '.join(v))
    print('####################')

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
inf = int(input())
i = 0
table = []
buil = [[[0]+10 for i in range(3)]for i in range(4)]

while(i < inf):
    b,f,r,v = map(int,input().split())
    b -=1
    f -=1
    r -=1
    buil[b][f][r] += c
    if buil[b][f][r] > 9: buil[b][f][r] = 9
    elif buil[b][f][r] < 0: buil[b][f][r] = 0
    i += 1

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

Submission status: Runtime Error

Solution code:
inf = int(input())
i = 0
table = []
buil = [[[0]+10 for i in range(3)]for i in range(4)]

while(i < inf):
    b,f,r,v = map(int,input().split())
    b -=1
    f -=1
    r -=1
    buil[b][f][r] += c
    if buil[b][f][r] > 9: buil[b][f][r] = 9
    elif buil[b][f][r] < 0: buil[b][f][r] = 0
    i += 1

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

Submission status: Runtime Error

Solution code:
inf = int(input())
i = 0
table = []
buil = [[[0]*10 for i in range(3)]for i in range(4)]

while(i < inf):
    b,f,r,v = map(int,input().split())
    b -=1
    f -=1
    r -=1
    buil[b][f][r] += c
    if buil[b][f][r] > 9: buil[b][f][r] = 9
    elif buil[b][f][r] < 0: buil[b][f][r] = 0
    i += 1

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

Submission status: Runtime Error

Solution code:
n = int(input())
tenants = {}
for i in range(n):
  tenant = list(map(int,input().split()))
  key = f'{b} {f} {r}'
  if key in d:
    d[key] += v
  else:
    d[key] = v
    
  b = tenant[0]
  f = tenant[1]
  r = tenant[2]
  v = tenant[3]
    
for b in range(1,5):
  for f in range(1,4):
    for r in range(1,11):
      key = f'{b} {f} {r}'
      if key in d:
        print(" "+str(d[key]),end="")
      else:
        print(" "+str(0),end="")
      if r == 10:
        print()
      if r == 10 and f == 3 and b != 4:
        print('####################')

Submission status: Runtime Error

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

count = int(input())

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

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

Submission status: Runtime Error

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

count = int(input())

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

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

Submission status: Runtime Error

Solution code:
int house[5][4][11];

int main(void)
{

  int n,i,j,k;
  int b,f,r,v;

  scanf("%d",&n);

  for(i = 0; i < n;i++)
    {
      scanf("%d %d %d %d",&b,&f,&r,&v);
      house[b][f][r] += v;
    }

      for(i = 1; i < 5;i++)
	{
	  for(j = 1; j < 4;j++)
	    {
	      for(k = 1; k < 11;k++)
		{
		  printf(" %d",house[i][j][k]);
		}
	      putchar('\n');
	    }
	  if(i != 4)printf("####################\n");
	}
      return 0;
}

Submission status: Runtime Error

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

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


for b in range(4):
    for f in range(3):
        for r in range(10):
            print(' {0}'.format(data[b][f][r]),end='')
        print()
    print('#' * 20)

Submission status: Runtime Error

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

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


for b in range(4):
    for f in range(3):
        for r in range(10):
            print(' {0}'.format(data[b][f][r]), end='')
        print()
    print('#' * 20)

Submission status: Runtime Error

Solution code:
 = Array.new(4){Array.new(3){Array.new(10,0)}}
b = gets.to_i
b.times do
  c = gets.split.map(&:to_i)
  a[c[0]-1][c[1]-1][c[2]-1] += c[3]
end
4.times do |i|
  3.times do |j|
   print " ",a[i][j].join(" "),"\n"
  end
   puts "#"*20
end

Submission status: Runtime Error

Solution code:
cards = {
        'S': [0 for _ in range(13)],
        'H': [0 for _ in range(13)],
        'C': [0 for _ in range(13)],
        'D': [0 for _ in range(13)],
}
n = int(input())
for _ in range(n):
    (s, r) = input().split()
    cards[s][int(r) - 1] = 1
 
for s in ('S', 'H', 'C', 'D'):
    for r in range(13):
        if cards[s][r] == 0:
            print(s, r + 1)

Submission status: Runtime Error

Solution code:
cards = {
        'S': [0 for _ in range(13)],
        'H': [0 for _ in range(13)],
        'C': [0 for _ in range(13)],
        'D': [0 for _ in range(13)],
}
n = int(input())
for _ in range(n):
    (s, r) = input().split()
    cards[s][int(r) - 1] = 1
  
for s in ('S', 'H', 'C', 'D'):
    for r in range(13):
        if cards[s][r] == 0:
            print(s, r + 1)

Submission status: Runtime Error

Solution code:
data = [[[0 for r in range(10)] for r in range(3)] for b in range(4)]
n = int(input())
     
for _ in range(n):
    (b, f, r, v) = [int(i) for i in input().split()]
     
for b in range(4):
    for f in range(3):
        for r in range(10):
        print('',data[b][f][r], end='')
    print()
print('#' * 20)

Submission status: Runtime Error

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

n = int(input())

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

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
import numpy as np
house=np.matrix('''0,0,0,0,0,0,0,0,0,0;0,0,0,0,0,0,0,0,0,0;0,0,0,0,0,0,0,0,0,0;
		0,0,0,0,0,0,0,0,0,0;0,0,0,0,0,0,0,0,0,0;0,0,0,0,0,0,0,0,0,0;
		0,0,0,0,0,0,0,0,0,0;0,0,0,0,0,0,0,0,0,0;0,0,0,0,0,0,0,0,0,0;
		0,0,0,0,0,0,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 xrange(1):
	b,f,r,v=1,1,3,8
	house[b*3-(4-f),r-1]+=v
for i in xrange(12):
	if i%3==0 and i!=0: print '#'*20
	for j in xrange(10):
		print house[i,j],
	print ""

Submission status: Runtime Error

Solution code:
import numpy as np
house=np.matrix('''0,0,0,0,0,0,0,0,0,0;0,0,0,0,0,0,0,0,0,0;0,0,0,0,0,0,0,0,0,0;
					0,0,0,0,0,0,0,0,0,0;0,0,0,0,0,0,0,0,0,0;0,0,0,0,0,0,0,0,0,0;
					0,0,0,0,0,0,0,0,0,0;0,0,0,0,0,0,0,0,0,0;0,0,0,0,0,0,0,0,0,0;
					0,0,0,0,0,0,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 xrange(int(raw_input())):
	b,f,r,v=map(int,raw_input().split())
	house[b*3-(4-f),r-1]+=v
	for i in xrange(12):
		if i%3==0 and i!=0: print '#'*20
		for j in xrange(10):
			print house[i,j],
		print ""

Submission status: Runtime Error

Solution code:
import numpy as np
house=np.matrix('''0,0,0,0,0,0,0,0,0,0;0,0,0,0,0,0,0,0,0,0;0,0,0,0,0,0,0,0,0,0;
					0,0,0,0,0,0,0,0,0,0;0,0,0,0,0,0,0,0,0,0;0,0,0,0,0,0,0,0,0,0;
					0,0,0,0,0,0,0,0,0,0;0,0,0,0,0,0,0,0,0,0;0,0,0,0,0,0,0,0,0,0;
					0,0,0,0,0,0,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 xrange(int(raw_input())):
	b,f,r,v=map(int,raw_input().split())
	house[b*3-(4-f),r-1]+=v
for i in xrange(12):
	if i%3==0 and i!=0: print '#'*20
	for j in xrange(10):
		print house[i,j],
	print ""

Submission status: Runtime Error

Solution code:
import numpy as np
house=np.matrix('''0,0,0,0,0,0,0,0,0,0;0,0,0,0,0,0,0,0,0,0;0,0,0,0,0,0,0,0,0,0;0,0,0,0,0,0,0,0,0,0;0,0,0,0,0,0,0,0,0,0;0,0,0,0,0,0,0,0,0,0;0,0,0,0,0,0,0,0,0,0;0,0,0,0,0,0,0,0,0,0;0,0,0,0,0,0,0,0,0,0;0,0,0,0,0,0,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 xrange(int(raw_input())):
	b,f,r,v=map(int,raw_input().split())
	house[b*3-(4-f),r-1]+=v
for i in xrange(12):
	if i%3==0 and i!=0: print '#'*20
	for j in xrange(9):
		print house[i,j],
	print house[i,9]

Submission status: Runtime Error

Solution code:
import numpy as np
house=np.matrix('''0,0,0,0,0,0,0,0,0,0;0,0,0,0,0,0,0,0,0,0;0,0,0,0,0,0,0,0,0,0;
0,0,0,0,0,0,0,0,0,0;0,0,0,0,0,0,0,0,0,0;0,0,0,0,0,0,0,0,0,0;
0,0,0,0,0,0,0,0,0,0;0,0,0,0,0,0,0,0,0,0;0,0,0,0,0,0,0,0,0,0;
0,0,0,0,0,0,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 xrange(int(raw_input())):
	b,f,r,v=map(int,raw_input().split())
	house[b*3-(4-f),r-1]+=v
for i in xrange(12):
	if i%3==0 and i!=0: print '#'*20
	print "",
	for j in xrange(9):
		print house[i,j],
	print house[i,9]

Submission status: Runtime Error

Solution code:
import numpy as np
house=np.matrix('''0,0,0,0,0,0,0,0,0,0;0,0,0,0,0,0,0,0,0,0;0,0,0,0,0,0,0,0,0,0;
0,0,0,0,0,0,0,0,0,0;0,0,0,0,0,0,0,0,0,0;0,0,0,0,0,0,0,0,0,0;
0,0,0,0,0,0,0,0,0,0;0,0,0,0,0,0,0,0,0,0;0,0,0,0,0,0,0,0,0,0;
0,0,0,0,0,0,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 xrange(int(raw_input())):
	b,f,r,v=map(int,raw_input().split())
	house[b*3-(4-f),r-1]+=v
for i in xrange(12):
	if i%3==0 and i!=0: print '#'*20
	print "",
	for j in xrange(10):
		print house[i,j],
	print ""

Submission status: Runtime Error

Solution code:
import sys
n = input()
a = [[[0]*10 for i in range(3)] for i in range(4)]
for i in xrange(n):
	b = map(int, raw_input().split())
	a[b[0]-1][b[1]-1][b[2]-1] += b[3]

for i in range(4):
	for j in range(3):
		for k in range(10):
			sys.stdout.write(' %s' % a[i][j][k])
		print ""
	if i != 3
	print '#'*20

Submission status: Runtime 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[2]-1][Inf[1]-1][Inf[0]-1] += Inf[0]

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

Solution code:
s = [[[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())
        s[b-1][f-1][r-1] += v
 
    for b in range(4):
        for f in range(3):
            print(" " + " ".join(map(str, s[b][f])))
        if b != 3:
            print("#"*20)

Submission status: Runtime Error

Solution code:
data =[[[0 for r in range(10)] for f in range(3)] for b in range(4)]
ans = ""
n = input()
for i in range(0, n):
    b, f, r, v = map(int, raw_input().split(" "))
    data[b-1][f-1][r-1] += v
    
for b in range(4):
    for f in range(3):
         for r in range(10):
                ans += " " + str(a[b][f][r])
         if(b != 3 or f != 2 or r !=9):
            ans += "\n"
    if(b !=3):
        ans += "#"*20 + "\n"
        
print ans

Submission status: Runtime Error

Solution code:
data =[[[0 for r in range(10)] for f in range(3)] for b in range(4)]
ans = ""
n = input()
for i in range(0, n):
    b, f, r, v = map(int, raw_input().split(" "))
    data[b-1][f-1][r-1] += v
    
for b in range(4):
    for f in range(3):
         for r in range(10):
                ans += " " + str(a[b][f][r])
         if(b != 3 or f != 2 or r !=9):
            ans += "\n"
    if(b !=3):
        ans += "#"*20 + "\n"
        
print(ans)

Submission status: Runtime 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
sd



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

Submission status: Runtime 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):
        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: Runtime Error

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

Submission status: Runtime Error

Solution code:
import numpy as np

#def area--------------------------#
#ryouno syokiti
class ryou:
	def flinit(self):
		room=list()
		for i in range(10):
			room+=[0]
		return room

#def kaijo([a_1,a_2,a_3,a_4,a_5,a_6,a_7,a_8,a_9,a_10]):


#def kaijo(x):
#	y=[]
#	for i in x:
#		y=y+ " "+x[i]
#	return y		
def kaijo(x):
	print "",
	for i in range(len(x)-1):
		print str(x[i]),
	print str(x[len(x)-1])


#----------------------------------#

floor_11=ryou().flinit()
floor_12=ryou().flinit()
floor_13=ryou().flinit()
floor_21=ryou().flinit()
floor_22=ryou().flinit()
floor_23=ryou().flinit()
floor_31=ryou().flinit()
floor_32=ryou().flinit()
floor_33=ryou().flinit()
floor_41=ryou().flinit()
floor_42=ryou().flinit()
floor_43=ryou().flinit()


fldic={"11":floor_11,
       "12":floor_12,
       "13":floor_13,
       "21":floor_21,
       "22":floor_22,
       "23":floor_23,
       "31":floor_31,
       "32":floor_32,
       "33":floor_33,
       "41":floor_41,
       "42":floor_42,
       "43":floor_43
       }

#----------------------------------#


#1kaime yomikomi
n=int(raw_input())

#nkaime syusyori

for l in range(n):
	list_mojiretsu=raw_input().split(" ")
	henka=map(int,list_mojiretsu)
	fldic[str(henka[0])+str(henka[1])][henka[2]-1]+=henka[3]
	
#henka=[3,4,5,6]



kaijo(floor_11)
kaijo(floor_12)
kaijo(floor_13)
print "####################"
kaijo(floor_21)
kaijo(floor_22)
kaijo(floor_23)
print "####################"
kaijo(floor_31)
kaijo(floor_32)
kaijo(floor_33)
print "####################"
kaijo(floor_41)
kaijo(floor_42)
kaijo(floor_43)

print "aiueo"
#print kaijo(floor_11)

Submission status: Runtime Error

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

for b in enumerate(data):
    for f in b:
        for r in f:
            print(' {0}'.format(r), end='')

        print()

    if bi < 3:
    print('#'* 20)

Submission status: Runtime Error

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

# ??\??????????????????????????§????????????????????????????????????


for b in enumerate(data):
    for f in b:
        for r in f:
            print(' {0}'.format(r), end='')

        print()

    if bi < 3:
    ??????print('#'* 20)

Submission status: Runtime Error

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

#??\?????????????????????????????§????????????????????????????????????
n = int(input())
for _ in range(n):
    (b, f, r, v) = [int(i) for i in input().split()]
    data[b - 1][f - 1][r - 1] += v
 
for b in range(4):
    for f in range(3):
        for r in range(10):
         
for bi, b in enumerate(data):
    for f in b:
        for r in f:
            print(' {0}'.format(r), end='')

        print()

    if bi < 3:
        print('#' * 20)

Submission status: Runtime Error

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

count = int(input())
for c in range(count):
    b, f, r, v = [int(i) for i in input().split()]
    data[b-1][f-1][r-1] += v
    
for bi, b in enumerate(data):
    for f in b:
        for r in f:
            print(' {0}'.format(r), end='')

        print()

    if bi < 3:
        print(

Submission status: Runtime Error

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

count = int(input())
for c in range(count):
    b, f, r, v = [int(i) for i in input().split()]
    data[b-1][f-1][r-1] += v
    
for bi, b in enumerate(data):
    for f in b:
        for r in f:
            print(' {0}'.format(r), end='')

        print()

    if bi < 3:
        print(

Submission status: Runtime Error

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

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

for b in enumerate(data):
    for f in b:
        for r in f:
            print(' {0}'.format(r), end='')

        print()

    if bi < 3:
    ??????print('#'* 20)

Submission status: Runtime Error

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

# ??\?????????????????????????????§????????????????????????????????????
coutnt = int(input(1))
for c in range(count):
    c, f, r, v = [int(1) for i in input().split]
    data[b - 1][f - 1][r - 1] += v
    

for bi, b in enumerate(data):
    for f in b:
        for r in f:
            print(' {0}'.format(r), end='')
    
        print()

    if bi < 3:
        print('#' * 20)

Submission status: Runtime Error

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

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

for bi, b in enumerate(data):
    for f in b:
        for r in f:
            print(' {0}'.format(r), end='')
    
        print()

    if bi < 3:
        print('#' * 20)

Submission status: Runtime Error

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


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

for b in enumerate(data):
    for f in b:
        for r in f:
            print(' {0}'.format(r), end='')

        print()

    if bi < 3:
    ??????print('#'* 20)

Submission status: Runtime Error

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

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

for bi, b in enumerate(data):
    for f in b:
        for r in f:
            print(' {0}'.format(r), end='')
    
        print()

    if bi < 3:
        print('#' * 20)

Submission status: Runtime Error

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

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

for bi, b in enumerate(data):
    for f in b:
        for r in f:
            print(' {0}'.format(r), end='')
    
        print()

    if bi < 3:
        print('#' * 20)

Submission status: Runtime Error

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

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

for bi, b in enumerate(data):
    for f in b:
        for r in f:
            print(' {0}'.format(r), end='')
    
        print()

    if bi < 3:
        print('#' * 20)

Submission status: Runtime Error

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

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

for bi, b in enumerate(data):
    for f in b:
        for r in f:
            print(' {0}'.format(r), end='')
    
        print()

    if bi < 3:
        print('#' * 20)

Submission status: Runtime Error

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

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

for bi, b in enumerate(data):
    for f in b:
        for r in f:
            print(' {0}'.format(r), end='')
    
        print()

Submission status: Runtime Error

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

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

for bi, b in enumerate(data):
    for f in b:
        for r in f:
            print(' {0}'.format(r), end='')
    
        print()
    print()

Submission status: Runtime Error

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

# ??\?????????????????????????????§????????????????????????????????????
count = int(input(1))
for c in range(count):
    c, f, r, v = [int(1) for i in input().split]
    data[c - 1][f - 1][r - 1] += v


for bi, b in enumerate(data):
    for f in b:
        for r in f:
            print(' {0}'.format(r), end='')

        print()

    if bi < 3:
        print('#' * 20)

Submission status: Runtime Error

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

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