#include<bits/stdc++.h>
using namespace std;
int a[405][405];
int Hx[8] = {1,1,-1,-1,2,2,-2,-2};
int Hy[8] = {2,-2,2,-2,1,-1,1,-1};
struct Stat {
int st, x, y;
};
queue<Stat> Q;
int main() {
ios::sync_with_stdio(false), cin.tie(0);
int n, m, X, Y;
cin >> n >> m >> X >> Y;
X--,Y--;
for (int i = 0; i < n; i++) for (int j = 0; j < m; j++)
a[i][j]=-1;
Stat s;
s.st=0;s.x=X;s.y=Y;
Q.push(s);
while(!Q.empty()) {
s=Q.front();
Q.pop();
a[s.x][s.y]=s.st;
for(int i = 0; i < 8; i++) {
int x=s.x+Hx[i],y=s.y+Hy[i];
if(x>=0 && x<n && y>=0 && y<m && a[x][y]==-1){
s.st+=1,s.x+=Hx[i],s.y+=Hy[i];
Q.push(s);
s.st-=1,s.x-=Hx[i],s.y-=Hy[i];
}
}
}
for (int i = 0; i < n; i++){
for (int j = 0; j < m; j++)
cout << a[i][j] << " ";
cout << '\n';
}
return 0;
}