import sys
input = sys.stdin.readline
h, w, x, y = map(int, input().split())
alist = [[0] * w for _ in range(h)]
blist = [list(map(int, input().split())) for _ in range(h + x)]
for i in range(h):
for j in range(w):
alist[i][j] = blist[i][j]
for i in range(x, h):
for j in range(y, w):
temp = alist[i][j] - alist[i - x][j - y]
alist[i][j] = temp
for lst in alist:
for l in lst:
print(l,end=" ")
print()