n,m,x,y = map(int,input().split())
maps = [[-1 for _ in range(m)] for _ in range(n)]
from collections import deque
def bfs(x,y,step):
queue = deque()
queue.append((x,y,step))
d = [[-1, 2], [-2, 1], [-2, -1], [-1, -2], [1, 2], [2, 1], [2, -1], [1, -2]]
maps[x][y] = 0
visit = [[0 for _ in range(m)] for _ in range(n)]
visit[x][y] = 1
while queue:
x,y,step = queue.popleft()
maps[x][y] = step
for xx,yy in d:
dx = x+xx
dy = y+yy
if 0<=dx<n and 0<=dy<m and visit[dx][dy] == 0:
visit[dx][dy] = 1
queue.append((dx,dy,step+1))
bfs(x-1,y-1,0)
for i in maps:
for j in i:
print(j,end='\t')
print('\n',end='')
05-26
05-25
1233
12-20