x = int(input())
y = int(input())
z = int(input())
xy = [[]]*x
yz = [[]]*y
xz = [[] for i in range(x)]
for i in range(x):
xy[i] = xy[i] + list(map(int,input().split()))
for i in range(y):
yz[i] = yz[i] + list(map(int,input().split()))
n = 0
for i in range(x):
for j in range(z):
nv = 0
for k in range(y):
nv = nv + xy[i][k] * yz[k][j]
# xz[i] = xz[i] + [str(nv)]
xz[i].append(str(nv))
for i in xz:
print(' '.join(i))
y = int(input())
z = int(input())
xy = [[]]*x
yz = [[]]*y
xz = [[] for i in range(x)]
for i in range(x):
xy[i] = xy[i] + list(map(int,input().split()))
for i in range(y):
yz[i] = yz[i] + list(map(int,input().split()))
n = 0
for i in range(x):
for j in range(z):
nv = 0
for k in range(y):
nv = nv + xy[i][k] * yz[k][j]
# xz[i] = xz[i] + [str(nv)]
xz[i].append(str(nv))
for i in xz:
print(' '.join(i))