static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
static BufferedWriter out = new BufferedWriter(new OutputStreamWriter(System.out));
static boolean[][] judge;
static int[] X = new int[] {-1,-2,-2,-1,1,2,2,1};
static int[] Y = new int[] {2,1,-1,-2,2,1,-1,-2};
public static void main(String[] args) throws IOException {
String[] S = br.readLine().split(" ");
n = Integer.parseInt(S[0]);
m = Integer.parseInt(S[1]);
x = Integer.parseInt(S[2]);
y = Integer.parseInt(S[3]);
distance = new int[n+1][m+1];
judge = new boolean[n+1][m+1];
for(int i = 1 ; i <= n ; i++) {
for(int j = 1 ; j <= m ; j++) {
for(int i = 1 ; i <= n ; i++) {
for(int j = 1 ; j <= m ; j++) {
System.out.printf("%-5d",distance[i][j]);
private static void BFS() {
Point begin = new Point();
Deque
deque = new LinkedList<>(); while(!deque.isEmpty()) {
for(int i = 0 ; i < 8 ; i++) {
if(a >= 1 && a <= n && b >= 1 && b<= m && !judge[a][b]) {
if(distance[a][b] == -1) {
distance[a][b] = distance[p.x][p.y] + 1;
distance[a][b] = Math.min(distance[a][b],distance[p.x][p.y]+1);