#include<stdio.h>
#include<stdlib.h>
int main()
{
int a, b, c, d;
long long int z[100][100], x[100][100], c1[100][100] = {};
while ( scanf("%d %d %d %d", &a, &b, &c, &d))
{
if (b!=c)
{
printf("error\r\n");
continue;
}
for (int i = 0;i < a;i++) {
for (int j = 0; j < b; j++)
{
scanf("%d ", &z[i][j]);
}
}
for (int i = 0;i < c;i++) {
for (int j = 0; j < d; j++)
{
scanf("%d ", &x[i][j]);
}
}
for (int i = 0;i < a;i++) {
for (int j = 0; j < d; j++)
{
for (int k = 0; k < c; k++)
{
c1 [i][j]+= z[i][k] * x[k][j];
}
printf("%d ", c1[i][j]);
}
printf("\r\n");
}
}
return 0;
}