Boboniu likes playing chess with his employees. As we know, no employee can beat the boss in the chess game, so Boboniu has never lost in any round.

You are a new applicant for his company. Boboniu will test you with the following chess question:

Consider a $n\times m$ grid (rows are numbered from $1$ to $n$, and columns are numbered from $1$ to $m$). You have a chess piece, and it stands at some cell $(S_x,S_y)$ which is not on the border (i.e. $2 \le S_x \le n-1$ and $2 \le S_y \le m-1$).

From the cell $(x,y)$, you can move your chess piece to $(x,y')$ ($1\le y'\le m, y' \neq y$) or $(x',y)$ ($1\le x'\le n, x'\neq x$). In other words, the chess piece moves as a rook. From the cell, you can move to any cell on the same row or column.

Your goal is to visit each cell exactly once. Can you find a solution?

Note that cells on the path between two adjacent cells in your route are not counted as visited, and it is not required to return to the starting point.


-----Input-----

The only line of the input contains four integers $n$, $m$, $S_x$ and $S_y$ ($3\le n,m\le 100$, $2 \le S_x \le n-1$, $2 \le S_y \le m-1$) — the number of rows, the number of columns, and the initial position of your chess piece, respectively.


-----Output-----

You should print $n\cdot m$ lines.

The $i$-th line should contain two integers $x_i$ and $y_i$ ($1 \leq x_i \leq n$, $1 \leq y_i \leq m$), denoting the $i$-th cell that you visited. You should print exactly $nm$ pairs $(x_i, y_i)$, they should cover all possible pairs $(x_i, y_i)$, such that $1 \leq x_i \leq n$, $1 \leq y_i \leq m$.

We can show that under these constraints there always exists a solution. If there are multiple answers, print any.


-----Examples-----
Input
3 3 2 2

Output
2 2
1 2
1 3
2 3
3 3
3 2
3 1
2 1
1 1

Input
3 4 2 2

Output
2 2
2 1
2 3
2 4
1 4
3 4
3 3
3 2
3 1
1 1
1 2
1 3



-----Note-----

Possible routes for two examples: [Image]

Difficulty: interview

Starter code:

Solutions:
n, m, sx, sy = list(map(int, input().split()))

print(sx, sy)

# its row
for j in range(1, m+1):
    if j != sy:
        print(sx, j)

# other rows
curr = m
for i in range(1, n+1):
    if i != sx:
        if curr == m:
            for j in range(m, 0, -1):
                print(i, j)
                curr = 0
        else:
            for j in range(1, m+1):
                print(i, j)
                curr = m


w,h,sx,sy = list(map(int,input().split()))

for x in range(sx, w+1):
    for y in range(sy, h+1):
        print(x,y)
    for y in range(1, sy):
        print(x,y)
    sy = y
for x in range(1, sx):
    for y in range(sy, h+1):
        print(x,y)
    for y in range(1, sy):
        print(x,y)
    sy = y


n,m,x,y=list(map(int,input().split()))
ii=y
print(x,y)
for c in range(1,m+1):
    if y!=c:
        print(x,c)
        ii=c
for r in range(1,n+1):
    if x!=r:
        print(r,ii)
        ij=0
        for c in range(1,m+1):
            if ii!=c:
                print(r,c)
                ij=c
        ii=ij


mod = 10**9 + 7
def solve():
    n, m, x, y = map(int, input().split())
    for i in range(n):
        for j in range(m):
            print(x, y)
            if j + 1 == m:
                continue
            y = y + 1
            if y > m:
                y = 1
        x = x + 1
        if x > n:
            x = 1
t = 1
for _ in range(t):
    solve()

n, m, x, y = list(map(int, input().split()))

result = [(x, y)]

for j in range(1, m + 1):
    if j == y:
        continue
    result.append((x, j))
for i in range(1, n + 1):
    if i == x:
        continue
    last = result[-1][1]
    result.append((i, last))
    for j in range(1, m + 1):
        if j == last:
            continue
        result.append((i, j))

for t in result:
    print(t[0], t[1])
        
        


mod=10**9+7
n,m,x,y=map(int,input().split())
for i in range (y,m+1):
    print(x,i)
for i in range (y-1,0,-1):
    print(x,i)
ch=0
for i in range (x+1,n+1):
    if ch==0:
        for j in range (1,m+1):
            print(i,j)
    else:
        for j in range (m,0,-1):
            print(i,j)
    ch=1-ch
for i in range (x-1,0,-1):
    if ch==0:
        for j in range (1,m+1):
            print(i,j)
    else:
        for j in range (m,0,-1):
            print(i,j)
    ch=1-ch

n,m,sx,sy = map(int,input().split())
moves = [(sx,sy)]
if sx != 1:
    moves.append((1,sy))
for i in range(1,m+1):
    if i!= sy:
        moves.append((1,i))
switch = 1
for row in range(2,n+1):
    if switch == 1:
        for col in range(m, 0, -1):
            if (row, col) == (sx,sy):
                continue
            moves.append((row,col))
    else:
        for col in range(1, m+1):
            if (row, col) == (sx,sy):
                continue
            moves.append((row,col))
    switch = 1- switch
for move in moves:
    print(move[0],move[1])

n, m, Sx, Sy = (int(i) for i in input().split())

print(Sx, Sy)

for x in range(1, n + 1):
    if x == Sx:
        continue
    
    print(x, Sy)

for y in range(1, m + 1):
    if y == Sy:
        continue

    if x == 1:
        for x in range(1, n + 1):
            print(x, y)
    elif x == n:
        for x in reversed(range(1, n + 1)):
            print(x, y)
    else:
        assert False

x,y,x0,y0 = map(int,input().split())
print(x0,y0)
print(1,y0)
print(1,1)
no = [(x0,y0),(1,y0),(1,1)]
ltor = True
for a in range(1,x+1):
	if ltor:
		for b in range(1,y+1):
			if (a,b) not in no:
				print(a,b)
	else:
		for b in range(y,0,-1):
			if (a,b) not in no:
				print(a,b)
	ltor = not ltor

n, m, x, y = list(map(int, input().split()))

print(x, y)
for i in range(1, m + 1):
    if i == y:
        continue
    print(x, i)

y_last = m
for i in range(1, n + 1):
    # print("> ---")
    if i == x:
        continue
    if y_last == m:
        for j in range(m, 0, -1):
            print(i, j)
        y_last = 1
        continue
    if y_last == 1:
        for j in range(1, m + 1):
            print(i, j)
        y_last = m


from collections import defaultdict as dd
import math
import sys
input=sys.stdin.readline
def nn():
	return int(input())

def li():
	return list(input())

def mi():
	return list(map(int, input().split()))

def lm():
	return list(map(int, input().split()))

def solve():
	n, m, x, y = mi()

	print(x,y)
	for i in range(1,m+1):
		if not i==y:
			print(x,i)
	par = 1
	for j in range(1,n+1):
		if not j==x:
			if par==0:
				for i in range(1,m+1):
					print(j,i)
			if par==1:
				for i in reversed(list(range(1,m+1))):
					print(j,i)
			par=(par+1)%2

	return

q=1
for _ in range(q):
	solve()


from sys import stdin
"""
n=int(stdin.readline().strip())
n,m=map(int,stdin.readline().strip().split())
s=list(map(int,stdin.readline().strip().split()))
"""
n,m,x,y=list(map(int,stdin.readline().strip().split()))
r=[y]
l=[x]
for i in range(1,m+1):
    if i==y:
        continue
    r.append(i)
for i in range(1,n+1):
    if i==x:
        continue
    l.append(i)
r1=r.copy()
r1=r1[::-1]
x=0
for i in l:
    if x%2==0:
        for j in r:
            print(i,j)
    else:
        for j in r1:
            print(i,j)
    x+=1
    
    
    


lst = [0, 0, 4, 8]
mod = 10 ** 9 + 7
for i in range(4, 10 ** 6 + 1):
    lst.append((lst[-1] * 2) % mod)


def main(case):
    n, m, x, y = list(map(int,input().split()))
    line = str(x) + " " + str(y) + "\n"
    for i in range(1, m + 1):
        if i != y:
            line += str(x) + " " + str(i) + "\n"
    cur = -1
    for i in range(1, n + 1):
        if i != x:
            if cur == -1:

                for k in range(m, 0, -1):
                    line += str(i) + " " + str(k) + "\n"
                cur = 1
            else:
                for k in range(1, m + 1):
                    line += str(i) + " " + str(k) + "\n"
                cur = -1
    line.strip("\n")
    print(line)
def __starting_point():
    t = 1
    for i in range(t):
        main(i + 1)

__starting_point()

import os
import sys
import math
import heapq
from decimal import *
from io import BytesIO, IOBase
from collections import defaultdict, deque

def r():
    return int(input())
def rm():
    return list(map(int,input().split()))
def rl():
    return list(map(int,input().split()))

n,m,x,y=rm()
print(x,y)
print(1,y)
go=True
for i in range(1,n+1):
    if go:
        for j in range(1,m+1):
            if (i==x and j==y) or (i==1 and j==y):
                continue
            print(i,j)
    else:
        for j in range(m,0,-1):
            if (i==x and j==y) or (i==1 and j==y):
                continue
            print(i,j)
    go = not go


#!/usr/bin/env python3
import sys
input = sys.stdin.readline

n, m, x, y = map(int, input().split())
x -= 1; y -= 1
ans = []
for _ in range(n):
    for j in range(m):
        ans.append((x+1, y+1))
        if j != m - 1:
            y = (y + 1) % m
        else:
            x = (x + 1) % n

for x, y in ans:
    print(x, y)

n,m,sx,sy = list(map(int, input().split()))

def do_row(sx, vis):
    last = -1
    for j in range(1, m+1):
        if (sx, j) not in vis:
            print(sx, j)
            vis.add((sx, j))
            last = j
    return last

vis = set()
vis.add((sx,sy))
print(sx,sy)
l = sy
l2 = do_row(sx, vis)
if l2 != -1:
    l = l2
for i in range(1,n+1):
    if (i, l) in vis:
        continue
    print(i, l)
    vis.add((i, l))
    l2 = do_row(i, vis)
    if l2 != -1:
        l = l2




n, m, sx, sy = map(int, input().split())
used = [[False] * m for i in range(n)]
print(sx, sy)
for j in range(1, sy):
    print(sx, j)
for j in range(sy + 1, m + 1):
    print(sx, j)
for i in range(n, 0, -1):
    if i != sx:
        print(i, m)
j = m - 1
k = 0
while j:
    k += 1
    if k % 2 == 1:
        for i in range(1, n + 1):
            if i != sx:
                print(i, j)
    else:
        for i in range(n, 0, -1):
            if i != sx:
                print(i, j)
    j -= 1

import math
from collections import deque
from sys import stdin, stdout
from string import ascii_letters
input = stdin.readline
#print = stdout.write
letters = ascii_letters[:26]

n, m, x, y = list(map(int, input().split()))
print(x, y)
for i in range(x, n + 1):
    if i % 2:
        for g in range(1, m + 1):
            if (i, g) == (x, y):
                continue
            print(i, g)
    else:
        for g in range(m, 0, -1):
            if (i, g) == (x, y):
                continue
            print(i, g)
inv = n % 2
for i in range(1, x):
    if (i % 2) if not inv else (1 - (i % 2)):
        for g in range(1, m + 1):
            if (i, g) == (x, y):
                continue
            print(i, g)
    else:
        for g in range(m, 0, -1):
            if (i, g) == (x, y):
                continue
            print(i, g)


n, m, x, y = list(map(int, input().split()))
print(x, y)
print(1, y)
for i in range(1, m+1):
    if i!=y:
        print(1, i)
curr = 0
for i in range(2, n+1):
    if curr%2==0:
        for j in range(m, 0,-1):
            if i!=x or j!=y:
                print(i, j)
    else:
        for j in range(1, m+1):
            if i!=x or j!=y:
                print(i, j)
    curr+=1


n, m, x, y = map(int, input().split())
print(x, y)
for i in range(1, m + 1):
    if i  != y:
        print(x, i)
t = False
for i in range(1, n + 1):
    if i != x:
        if t:
            for j in range(1, m + 1):
                print(i, j)
        else:
            for j in range(m, 0, -1):
                print(i, j)
                
        t = not t

import sys
import heapq, functools, collections
import math, random
from collections import Counter, defaultdict

# available on Google, not available on Codeforces
# import numpy as np
# import scipy


def solve(h,w,x,y):  # fix inputs here
    console("----- solving ------")
    x,y = x-1,y-1

    for _ in range(h):
        for _ in range(w):
            print("{} {}".format(x+1,y+1))
            y = (y+1)%w
        y = (y-1)%w
        x = (x+1)%h
    
    return

def console(*args):  # the judge will not read these print statement
    print('\033[36m', *args, '\033[0m', file=sys.stderr)
    return

# fast read all
# sys.stdin.readlines()

# for case_num in range(int(input())):
    # read line as a string
    # strr = input()

    # read line as an integer
    # k = int(input())
    
    # read one line and parse each word as a string
    # lst = input().split()

    # read one line and parse each word as an integer
h,w,x,y = list(map(int,input().split()))

    # read matrix and parse as integers (after reading read nrows)
    # lst = list(map(int,input().split()))
    # nrows = lst[0]  # index containing information, please change
    # grid = []
    # for _ in range(nrows):
    #     grid.append(list(map(int,input().split())))

solve(h,w,x,y)  # please change
    
    # Google - case number required
    # print("Case #{}: {}".format(case_num+1, res))

    # Codeforces - no case number required
    # print(res)