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: EASY

Solutions:
(n, m, x, y) = map(int, input().split())
vis = [[0 for i in range(m + 2)] for j in range(n + 2)]
for i in range(m + 2):
	vis[0][i] = 1
	vis[n + 1][i] = 1
for i in range(n + 2):
	vis[i][0] = 1
	vis[i][m + 1] = 1
moves = [[x, y]]
vis[x][y] = 1
cc = 3
moves.append([1, y])
moves.append([1, 1])
vis[1][y] = 1
vis[1][1] = 1
(x, y) = (1, 1)
while cc < n * m:
	if x % 2 != 0:
		for i in range(1, m + 1):
			if vis[x][i] != 1:
				vis[x][i] = 1
				y = i
				moves.append([x, y])
				cc += 1
	else:
		for i in range(m, 0, -1):
			if vis[x][i] != 1:
				vis[x][i] = 1
				y = i
				moves.append([x, y])
				cc += 1
	x += 1
for i in moves:
	print(*i)


from sys import stdin
input = stdin.readline
(n, m, a, b) = map(int, input().split())
s = [[a, b], [1, b]]
print(a, b)
print(1, b)
for x in range(1, n + 1):
	if x % 2 == 1:
		for y in range(1, m + 1):
			if [x, y] not in s:
				print(x, y)
	else:
		for y in range(m, 0, -1):
			if [x, y] not in s:
				print(x, y)


(n, m, x, y) = map(int, input().split())
l = [[0] * m] * n
ans = []
ans.append([x, y])
if x != 1:
	ans.append([1, y])
i = 0
while i < y - 1:
	ans.append([1, i + 1])
	i += 1
i = y
while i < m:
	ans.append([1, i + 1])
	i += 1
for i in range(1, n):
	if i % 2 != 0:
		for j in range(m - 1, -1, -1):
			if [i + 1, j + 1] != [x, y]:
				ans.append([i + 1, j + 1])
	elif i % 2 == 0:
		for j in range(0, m):
			if [i + 1, j + 1] != [x, y]:
				ans.append([i + 1, j + 1])
for i in range(len(ans)):
	print(*ans[i])


from sys import stdin
input = stdin.buffer.readline
(n, m, x, y) = map(int, input().split())
print(x, y)
print(1, y)
i = j = c = 1
while i <= n:
	if c:
		while j <= m:
			if (i, j) not in [(x, y), (1, y)]:
				print(i, j)
			j += 1
		j -= 1
	else:
		while j >= 1:
			if (i, j) not in [(x, y), (1, y)]:
				print(i, j)
			j -= 1
		j += 1
	i += 1
	c ^= 1


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


def modinv(n, p):
	return pow(n, p - 2, p)

def main():
	(n, m, x, y) = [int(x) for x in input().split()]
	print(x, y)
	if x != 1:
		print(1, y)
	if y != 1:
		print(1, 1)
	i = 1
	while i <= n:
		if i % 2 == 1:
			for j in range(1, m + 1):
				if [i, j] not in [[x, y], [1, y], [1, 1]]:
					print(i, j)
		else:
			for j in range(m, 0, -1):
				if [i, j] not in [[x, y], [1, y], [1, 1]]:
					print(i, j)
		i += 1
py2 = round(0.5)
if py2:
	from future_builtins import ascii, filter, hex, map, oct, zip
	range = xrange
import os, sys
from io import IOBase, BytesIO
BUFSIZE = 8192

class FastIO(BytesIO):
	newlines = 0

	def __init__(self, file):
		self._file = file
		self._fd = file.fileno()
		self.writable = 'x' in file.mode or 'w' in file.mode
		self.write = super(FastIO, self).write if self.writable else None

	def _fill(self):
		s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
		self.seek((self.tell(), self.seek(0, 2), super(FastIO, self).write(s))[0])
		return s

	def read(self):
		while self._fill():
			pass
		return super(FastIO, self).read()

	def readline(self):
		while self.newlines == 0:
			s = self._fill()
			self.newlines = s.count(b'\n') + (not s)
		self.newlines -= 1
		return super(FastIO, self).readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.getvalue())
			(self.truncate(0), self.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		if py2:
			self.write = self.buffer.write
			self.read = self.buffer.read
			self.readline = self.buffer.readline
		else:
			self.write = lambda s: self.buffer.write(s.encode('ascii'))
			self.read = lambda : self.buffer.read().decode('ascii')
			self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


(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


import sys
import math

def II():
	return int(sys.stdin.readline())

def LI():
	return list(map(int, sys.stdin.readline().split()))

def MI():
	return map(int, sys.stdin.readline().split())

def SI():
	return sys.stdin.readline().strip()
(n, m, x, y) = MI()
d = []
for i in range(n):
	d.append([0] * m)
d[x - 1][y - 1] = 1
ans = [[x, y]]
d[0][y - 1] = 1
ans.append([1, y])
for i in range(n):
	for j in range(m):
		if i % 2 == 0:
			if d[i][j] != 1:
				d[i][j] == 1
				ans.append([i + 1, j + 1])
		elif d[i][m - 1 - j] != 1:
			d[i][m - 1 - j] == 1
			ans.append([i + 1, m - 1 - j + 1])
for i in ans:
	print(*i)


t = 1
ans = []

def solve(n, m, x, y):
	ans = []
	one = (x, y)
	two = (1, y)
	three = (1, 1)
	print(one[0], one[1])
	print(two[0], two[1])
	print(three[0], three[1])
	for x1 in range(1, n + 1):
		row = []
		for y1 in range(1, m + 1):
			if (x1, y1) == one or (x1, y1) == two or (x1, y1) == three:
				continue
			row.append((x1, y1))
		if x1 % 2 == 0:
			ans.append(row[::-1])
		else:
			ans.append(row)
	return ans
for i in range(t):
	s = [int(x) for x in input().split()]
	n = s[0]
	m = s[1]
	x = s[2]
	y = s[3]
	a = solve(n, m, x, y)
	for l in a:
		for z in l:
			print(z[0], z[1])


import os
import sys
from io import BytesIO, IOBase
import threading
from math import factorial as fac
from collections import deque, defaultdict

def main():
	(n, m, sx, sy) = map(int, input().split())
	visited = [(1, sy), (1, 1), (sx, sy)]
	print(f'{sx} {sy}')
	print(f'{1} {sy}')
	print(f'{1} {1}')
	increase = False
	col = m
	for i in range(1, n + 1):
		if i % 2 == 0:
			col = m
			increase = False
		else:
			col = 1
			increase = True
		for _ in range(1, m + 1):
			if (i, col) not in visited:
				print(f'{i} {col}')
			if increase:
				col += 1
			else:
				col -= 1
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


(n, m, x, y) = map(int, input().split())
arr = [[0] * m] * n
arr[x - 1][y - 1] = 1
arr[0][y - 1] = 1
print(x, y)
print(1, y)
p = 0
for i in range(0, len(arr)):
	for j in range(0, len(arr[0])):
		if i % 2 == 1:
			j = len(arr[0]) - j - 1
		trr = [i, j]
		if not (trr == [x - 1, y - 1] or trr == [0, y - 1]):
			print(i + 1, j + 1)


(n, m, Sx, Sy) = list(map(int, input().split()))
print(Sx, Sy)
print(1, Sy)
for i in range(1, n + 1):
	if i % 2 == 1:
		for j in range(1, m + 1):
			if i == 1 and j == Sy or (i == Sx and j == Sy):
				pass
			else:
				print(i, j)
	else:
		for j in range(m, 0, -1):
			if i == Sx and j == Sy:
				pass
			else:
				print(i, j)


(n, m, sx, sy) = map(int, input().split())
print(sx, sy)
print(1, sy)
for i in range(1, n + 1, 2):
	for j in range(1, m + 1):
		if j == sy and (i == 1 or i == sx):
			pass
		else:
			print(i, j)
	if i < n:
		for j in range(m, 0, -1):
			if j == sy and (i + 1 == 1 or i + 1 == sx):
				pass
			else:
				print(i + 1, j)


(n, m, x, y) = map(int, input().split())
a = [x, y]
b = [1, y]
print(*a)
print(*b)
for i in range(1, n + 1):
	if i % 2 != 0:
		for j in range(1, m + 1):
			if [i, j] not in [a, b]:
				print(i, j)
	else:
		for j in range(m, 0, -1):
			if [i, j] not in [a, b]:
				print(i, j)


(n, m, x, y) = map(int, input().split())
print(x, y)
print(1, y)
ans = ''
for i in range(1, n + 1, 2):
	for j in range(1, m + 1):
		if j == y and i in [1, x]:
			continue
		ans += f'{i} {j}\n'
	for j in range(m, 0, -1):
		if i == n:
			break
		if j == y and i + 1 in [1, x]:
			continue
		ans += f'{i + 1} {j}\n'
print(ans)


(n, m, sx, sy) = [int(i) for i in input().split(' ')]

def prt(a, b):
	print(str(a) + ' ' + str(b))
cl = [(1, sy), (sx, sy)]
prt(sx, sy)
prt(1, sy)
for i in range(1, n + 1):
	if i % 2 == 1:
		for j in range(1, m + 1):
			if not (i, j) in cl:
				prt(i, j)
	else:
		for j in range(m, 0, -1):
			if not (i, j) in cl:
				prt(i, j)


import sys
input = lambda : sys.stdin.readline().strip()
char = [chr(i) for i in range(97, 123)]
CHAR = [chr(i) for i in range(65, 91)]
mp = lambda : list(map(int, input().split()))
INT = lambda : int(input())
rn = lambda : range(INT())
from math import ceil, sqrt, factorial, gcd
(n, m, x, y) = mp()
l = []
if x != 1 and y != 1:
	l.append((x, y))
	l.append((1, y))
elif x != 1:
	l.append((x, y))
elif y != 1:
	l.append((x, y))
d = set(l)
for i in range(1, n + 1):
	for j in range(1, m + 1):
		if i % 2 == 1:
			h = (i, j)
			if h not in d:
				l.append(h)
				d.add(h)
		else:
			h = (i, m + 1 - j)
			if h not in d:
				l.append(h)
				d.add(h)
for k in l:
	print(*k)


(n, m, sx, sy) = [int(x) for x in input().split(' ')]
print(sx, sy)
print(1, sy)
print(1, 1)
j = 1
while j <= n:
	if j % 2:
		for i in range(1, m + 1):
			if i == 1 and j == 1 or (i == sy and j == sx) or (i == sy and j == 1):
				continue
			print(j, i)
	else:
		for i in range(m, 0, -1):
			if i == 1 and j == 1 or (i == sy and j == sx) or (i == sy and j == 1):
				continue
			print(j, i)
	j += 1


(r, c, x, y) = map(int, input().split())
print('%d %d' % (x, y))
print('%d %d' % (1, y))
for i in range(1, r + 1):
	if i % 2 == 1:
		for j in range(1, c + 1):
			if i == x and j == y or (i == 1 and j == y):
				pass
			else:
				print(i, j)
	else:
		for j in range(c, 0, -1):
			if i == x and j == y or (i == 1 and j == y):
				pass
			else:
				print(i, j)


(n, m, x, y) = map(int, input().split())
print(x, y)
print(1, y)
print(1, 1)
flag = 0
for i in range(n):
	if flag == 0:
		for j in range(m):
			if i == 0:
				if j == y - 1 or j == 0:
					continue
				else:
					print(i + 1, j + 1)
			elif i == x - 1 and j == y - 1:
				continue
			else:
				print(i + 1, j + 1)
		flag = 1
	else:
		for j in reversed(range(m)):
			if i == 0:
				if j == y - 1 or j == 0:
					continue
				else:
					print(i + 1, j + 1)
			elif i == x - 1 and j == y - 1:
				continue
			else:
				print(i + 1, j + 1)
		flag = 0


import sys
import math
import itertools
import functools
import collections
import operator
import fileinput
import copy
ORDA = 97

def ii():
	return int(input())

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

def li():
	return [int(i) for i in input().split()]

def lcm(a, b):
	return abs(a * b) // math.gcd(a, b)

def revn(n):
	return str(n)[::-1]

def dd():
	return collections.defaultdict(int)

def ddl():
	return collections.defaultdict(list)

def sieve(n):
	if n < 2:
		return list()
	prime = [True for _ in range(n + 1)]
	p = 3
	while p * p <= n:
		if prime[p]:
			for i in range(p * 2, n + 1, p):
				prime[i] = False
		p += 2
	r = [2]
	for p in range(3, n + 1, 2):
		if prime[p]:
			r.append(p)
	return r

def divs(n, start=2):
	r = []
	for i in range(start, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n / i == i:
				r.append(i)
			else:
				r.extend([i, n // i])
	return r

def divn(n, primes):
	divs_number = 1
	for i in primes:
		if n == 1:
			return divs_number
		t = 1
		while n % i == 0:
			t += 1
			n //= i
		divs_number *= t

def prime(n):
	if n == 2:
		return True
	if n % 2 == 0 or n <= 1:
		return False
	sqr = int(math.sqrt(n)) + 1
	for d in range(3, sqr, 2):
		if n % d == 0:
			return False
	return True

def convn(number, base):
	new_number = 0
	while number > 0:
		new_number += number % base
		number //= base
	return new_number

def cdiv(n, k):
	return n // k + (n % k != 0)

def ispal(s):
	for i in range(len(s) // 2 + 1):
		if s[i] != s[-i - 1]:
			return False
	return True
(n, m, sx, sy) = mi()
ans = [[sx, sy], [1, sy]]
for i in range(1, m + 1):
	if i != sy:
		ans.append([1, i])
for i in range(2, n + 1):
	if i & 1:
		for j in range(1, m + 1):
			if [i, j] == [sx, sy]:
				continue
			else:
				ans.append([i, j])
	else:
		for j in range(m, 0, -1):
			if [i, j] == [sx, sy]:
				continue
			else:
				ans.append([i, j])
for i in ans:
	print(*i)


(n, m, initx, init_y) = map(int, input().split(' '))
print(initx, init_y)
print(1, init_y)
j1 = list(range(1, m + 1))
j2 = list(range(1, m + 1))
j2.reverse()
for i in range(1, n + 1):
	if i % 2 == 1:
		for j in j1:
			if i == initx and j == init_y or (i == 1 and j == init_y):
				continue
			else:
				print(i, j)
	else:
		for j in j2:
			if i == initx and j == init_y or (i == 1 and j == init_y):
				continue
			else:
				print(i, j)


import random

def gcd(a, b):
	if a == 0:
		return b
	return gcd(b % a, a)

def lcm(a, b):
	return a * b / gcd(a, b)
(n, m, x, y) = map(int, input().split())
vis = [[0 for i in range(m)] for j in range(n)]
vis[x - 1][y - 1] = 1
vis[0][y - 1] = 1
vis[0][0] = 1
print(x, y)
print(1, y)
print(1, 1)
f = 0
for i in range(n):
	if f == 0:
		for j in range(m):
			if vis[i][j] == 0:
				vis[i][j] = 1
				print(i + 1, j + 1)
		f = 1
	else:
		for j in range(m - 1, -1, -1):
			if vis[i][j] == 0:
				vis[i][j] = 1
				print(i + 1, j + 1)
		f = 0


(n, m, sx, sy) = map(int, input().split())
hashset = set()
hashset.add((sx, sy))
print(sx, sy)
if (1, sy) not in hashset:
	hashset.add((1, sy))
	print(1, sy)
if (1, 1) not in hashset:
	hashset.add((1, 1))
	print(1, 1)
(x, y) = (1, 1)
while len(hashset) < n * m:
	for j in range(1, m + 1):
		if (x, j) not in hashset:
			hashset.add((x, j))
			print(x, j)
	x += 1
	if len(hashset) < n * m:
		for j in range(m, 0, -1):
			if (x, j) not in hashset:
				hashset.add((x, j))
				print(x, j)
		x += 1


(n, m, x, y) = map(int, input().split())
mat = [[False] * m for i in range(n)]
x -= 1
y -= 1
(i, j) = (x, y)
print(i + 1, j + 1)
mat[i][j] = True
print(1, j + 1)
mat[0][j] = True
front = True
(i, j) = (0, 0)
while i < n and j < m:
	if not mat[i][j]:
		print(i + 1, j + 1)
		mat[i][j] = True
	if j == m - 1 and front or (j == 0 and (not front)):
		i += 1
		front = not front
	elif front:
		j += 1
	else:
		j -= 1


arr = list(map(int, input().split()))
n = arr[0]
m = arr[1]
sx = arr[2]
sy = arr[3]
sol = []
sol.append([sx, sy])
sol.append([1, sy])
j = 1
for i in range(1, n + 1):
	if j == 1:
		ini = 1
		fin = m + 1
		inc = 1
	else:
		ini = m
		fin = 0
		inc = -1
	for j in range(ini, fin, inc):
		if j == sy and i == 1:
			continue
		if i == sx and j == sy:
			continue
		sol.append([i, j])
for i in sol:
	print(*i)


def main():
	(n, m, x, y) = map(int, input().split())
	d = {}
	k = str(x) + str(y)
	d[k] = 1
	print(x, y)
	print(1, y)
	t1 = 0
	t2 = y
	d[str(0) + str(y)] = 1
	i = 0
	while i < n:
		for j in range(m):
			if i + 1 == x and j + 1 == y:
				continue
			elif i + 1 == 1 and j + 1 == y:
				continue
			else:
				print(i + 1, j + 1)
		i += 1
		if i >= n:
			break
		for j in range(m, 0, -1):
			if i + 1 == x and j == y:
				continue
			elif i + 1 == 1 and j == y:
				continue
			else:
				print(i + 1, j)
		i += 1
main()


def gt():
	return list(map(int, input().split()))
(n, m, x, y) = gt()
vis = [[0 for j in range(m + 1)] for i in range(n + 1)]

def run(r, bk=0):
	for i in range(1, m + 1) if bk == 0 else range(m, 0, -1):
		if vis[r][i] == 0:
			vis[r][i] = 1
			print(r, i)
vis[x][y] = 1
print(x, y)
vis[1][y] = 1
print(1, y)
for i in range(1, n + 1):
	run(i, i & 1 ^ 1)


(n, m, sx, sy) = map(int, input().split())
l1 = []
check = []
l1.append([sx, sy])
check.append([sx, sy])
if [1, sy] not in check:
	l1.append([1, sy])
	check.append([1, sy])
if [1, 1] not in check:
	l1.append([1, 1])
	check.append([1, 1])
curr = 1
while curr <= n:
	if curr % 2 == 0:
		for i in range(m, 0, -1):
			if [curr, i] not in check:
				l1.append([curr, i])
		curr = curr + 1
	else:
		for i in range(1, m + 1):
			if [curr, i] not in check:
				l1.append([curr, i])
		curr = curr + 1
for i in l1:
	print(*i)


def main():
	(n, m, fx, fy) = map(int, input().split())
	(sx, sy) = (1, fy)
	ANS = []
	ANS.append((fx, fy))
	if fx != 1:
		ANS.append((sx, sy))
	for i in range(1, n + 1):
		if i % 2 == 1:
			for j in range(1, m + 1):
				if i == fx and j == fy or (i == sx and j == fy):
					continue
				ANS.append((i, j))
		else:
			for j in range(m, 0, -1):
				if i == fx and j == fy or (i == sx and j == fy):
					continue
				ANS.append((i, j))
	print('\n'.join([' '.join(map(str, ans)) for ans in ANS]))
main()


def answer(n, m, x, y):
	d = {(x, y): 1, (1, y): 1}
	l = [[x, y], [1, y]]
	flag = 0
	for i in range(1, n + 1):
		if flag == 0:
			for j in range(1, m + 1):
				if (i, j) not in d:
					l.append([i, j])
			flag = 1
		elif flag == 1:
			for j in range(m, 0, -1):
				if (i, j) not in d:
					l.append([i, j])
			flag = 0
	return l
(n, m, x, y) = map(int, input().split())
l = answer(n, m, x, y)
for i in l:
	print(*i)


import sys

def main():
	(n, m, sx, sy) = map(int, sys.stdin.readline().split())
	P = [(sx, sy), (1, sy), (1, 1)]
	dy = 1
	(tx, ty) = (1, 1)
	for i in range(1, n + 1):
		for j in range(1, m + 1):
			ty += dy
			if ty > m:
				tx += 1
				ty = m
				dy = -dy
			elif ty < 1:
				tx += 1
				ty = 1
				dy = -dy
			elif tx == 1 and ty == sy or (tx == sx and ty == sy):
				continue
			P.append((tx, ty))
	print('\n'.join((' '.join(map(str, p)) for p in P[:-1])))
main()


(n, m, sx, sy) = map(int, input().split())
book = [[0 for i in range(m + 1)] for i in range(n + 1)]
print(sx, sy)
print(1, sy)
book[sx][sy] == 1
book[1][sy] == 1
for i in range(1, n + 1):
	if i % 2 == 0:
		j = m
		while j >= 1:
			if not (i == 1 and j == sy or (i == sx and j == sy)):
				print(i, j)
			j -= 1
	else:
		j = 1
		while j <= m:
			if not (i == 1 and j == sy or (i == sx and j == sy)):
				print(i, j)
			j += 1


(n, m, a, b) = map(int, input().split())
grid = []
for f in range(n):
	e = []
	for d in range(m):
		e.append(d + 1)
	grid.append(e)
grid[a - 1][b - 1] = 0
print(a, b)
grid[0][b - 1] = 0
print(1, b)
count = 0
for r in grid:
	count += 1
	if count % 2 == 0:
		r = r[::-1]
	for c in r:
		if c != 0:
			print(count, c)


(n, m, sx, sy) = [int(i) for i in input().split(' ')]
print(str(sx) + ' ' + str(sy))
print(str(1) + ' ' + str(sy))
print(str(1) + ' ' + str(1))
ls = [(sx, sy), (1, 1), (1, sy)]
for i in range(1, n + 1):
	for j in range(1, m + 1):
		if i % 2 == 0:
			if (i, m - j + 1) not in ls:
				print(str(i) + ' ' + str(m - j + 1))
		elif (i, j) not in ls:
			print(str(i) + ' ' + str(j))


(n, m, x, y) = input().split()
m = int(m)
n = int(n)
x = int(x)
y = int(y)
print(x, y)
a = x
b = y
print(1, y)
print(1, 1)
x = 1
y = 1
for i in range(n):
	for j in range(m):
		if abs(x) == a and abs(y) == b or (abs(x) == 1 and abs(y) == b) or (x == 1 and y == 1):
			y = y
		else:
			print(x, abs(y))
		y = y + 1
	x += 1
	if y == m + 1:
		y = -y + 1
	else:
		y = 1


import sys
from math import *
(n, m, x, y) = map(int, input().split())
vis = [[0 for j in range(m + 1)] for i in range(n + 1)]
print(x, y)
vis[x][y] = 1
print(1, y)
vis[1][y] = 1
print(1, 1)
vis[1][1] = 1
c = 1
for i in range(1, n + 1):
	if c == 1:
		a = 1
		b = m + 1
	else:
		a = m
		b = 0
	for j in range(a, b, c):
		if not vis[i][j]:
			print(i, j)
			vis[i][j] = 1
	c = -c


(n, m, x, y) = map(int, input().split())
visited = {(x, y)}
print(x, y)
if x != 1:
	print(1, y)
	visited.add((1, y))
for i in range(1, n + 1):
	for j in range(1, m + 1):
		val = j
		if i % 2 == 0:
			val = m + 1 - j
		cell = (i, val)
		if cell not in visited:
			print(cell[0], cell[1])


from collections import Counter
import string
import math
import sys

def array_int():
	return [int(i) for i in sys.stdin.readline().split()]

def vary(arrber_of_variables):
	if arrber_of_variables == 1:
		return int(sys.stdin.readline())
	if arrber_of_variables >= 2:
		return map(int, sys.stdin.readline().split())

def makedict(var):
	return dict(Counter(var))
mod = 1000000007
(n, m, x, y) = vary(4)
arr = []
s = set()
s.add((x, y))
print(x, y)
print(1, y)
s.add((1, y))
print(1, 1)
s.add((1, 1))
for i in range(1, n + 1):
	if i % 2 != 0:
		for j in range(1, m + 1):
			if (i, j) not in s:
				print(i, j)
				s.add((i, j))
	else:
		for j in range(m, 0, -1):
			if (i, j) not in s:
				print(i, j)
				s.add((i, j))


(n, m, ns, ms) = map(int, input().split(' '))
print(f'{ns} {ms}')
print(f'1 {ms}')
for i in range(1, n + 1):
	for j in range(1, m + 1):
		(x, y) = (i, j) if i % 2 else (i, m - j + 1)
		if (x, y) != (ns, ms) and (x, y) != (1, ms):
			print(f'{x} {y}')


def gns():
	return list(map(int, input().split()))
(n, m, x, y) = gns()
print(x, y)
print(1, y)
print(1, 1)
for i in range(1, n + 1):
	r = range(1, m + 1)
	if i % 2 == 0:
		r = reversed(r)
	for j in r:
		if (i, j) == (1, y) or (i, j) == (x, y) or (i, j) == (1, 1):
			continue
		print(i, j)


(n, m, x, y) = map(int, input().split())
print(x, y)
x1 = 1
y1 = y
print(x1, y1)
k = 1
j = 1
for i in range(1, n + 1):
	while 0 < j < m + 1:
		if (i != x or j != y) and (i != x1 or j != y1):
			print(i, j)
		j = j + k
	k = -k
	j += k


import sys
reader = (s.rstrip() for s in sys.stdin)
input = reader.__next__
(n, m, x, y) = map(int, input().split())
print(x, y)
visited = [[0 for i in range(m + 1)] for j in range(n + 1)]
visited[x][y] = 1
print(1, y)
visited[1][y] = 1
print(1, 1)
visited[1][1] = 1
flag = 1
for i in range(1, n + 1):
	if flag:
		for j in range(1, m + 1):
			if not visited[i][j]:
				print(i, j)
				visited[i][j] = 1
	else:
		for j in range(m, 0, -1):
			if not visited[i][j]:
				print(i, j)
				visited[i][j] = 1
	flag = flag ^ 1


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


(n, m, x, y) = [int(k) for k in input().split()]
li = []
for i in range(1, n + 1):
	for j in range(1, m + 1):
		li.append([i, j])
print(x, y)
li.remove([x, y])
print(1, y)
li.remove([1, y])
cx = 1
while cx < n + 1:
	for jj in range(1, m + 1):
		if [cx, jj] in li:
			cy = jj
			print(cx, cy)
			li.remove([cx, cy])
	cx += 1
	for jj in range(m, 0, -1):
		if [cx, jj] in li:
			cy = jj
			print(cx, cy)
			li.remove([cx, cy])
	cx += 1


(n, m, x, y) = map(int, input().split())
s = {(x, y)}
print(x, y)
if x != 1:
	print(1, y)
	s.add((1, y))
if y != 1:
	print(1, 1)
	s.add((1, 1))
count = 0
while count < n * m:
	i = 1
	j = 1
	while i <= n:
		while j <= m:
			count += 1
			if (i, j) in s:
				j += 1
				continue
			else:
				print(i, j)
				s.add((i, j))
				j += 1
		if j > m:
			j = m
			i += 1
			if i <= n:
				while j >= 1:
					count += 1
					if (i, j) in s:
						j -= 1
						continue
					else:
						print(i, j)
						s.add((i, j))
						j -= 1
				if j < 1:
					j = 1
					i += 1


import sys
from math import ceil, factorial, gcd
from collections import Counter, deque, defaultdict
from bisect import bisect_left, bisect_right
from heapq import heappop, heappush, heapify
MOD = 10 ** 9 + 7
INF = float('inf')
rl = lambda : list(map(int, sys.stdin.readline().split()))
rs = lambda : sys.stdin.readline().strip()
(n, m, sx, sy) = rl()
visited = [[False for _ in range(m + 1)] for _ in range(n + 1)]
visited[sx][sy] = True
visited[1][sy] = True
print(sx, sy)
print(1, sy)
for row in range(1, n + 1):
	if row % 2:
		for col in range(1, m + 1):
			if not visited[row][col]:
				print(row, col)
	else:
		for col in range(m, 0, -1):
			if not visited[row][col]:
				print(row, col)


(n, m, x, y) = map(int, input().split())
print(x, y)
print(1, y)
(f1, f2) = (x, y)
for x in range(1, n + 1):
	if x % 2 != 0:
		for y in range(1, m + 1):
			if [x, y] != [f1, f2] and [x, y] != [1, f2]:
				print(x, y)
	else:
		for y in range(m, 0, -1):
			if [x, y] != [f1, f2] and [x, y] != [1, f2]:
				print(x, y)


(n, m, x, y) = map(int, input().split())
used = [[0 for i in range(m)] for i in range(n)]
x -= 1
y -= 1
used[x][y] = 1
used[0][y] = 1
print(x + 1, y + 1)
print(1, y + 1)
x = y = 0
for i in range(n * m - 3):
	print(x + 1, y + 1)
	used[x][y] = 1
	q = x % 2
	if q == 0:
		if y == m - 1:
			x += 1
		else:
			y += 1
			if used[x][y] == 1:
				y += 1
	elif y == 0:
		x += 1
	else:
		y -= 1
		if used[x][y] == 1:
			y -= 1
print(x + 1, y + 1)


(n, m, x, y) = list(map(int, input().split()))
matrix = [[0] * m for i in range(n)]
ans = [[x, y]]
matrix[x - 1][y - 1] = 1
matrix[0][y - 1] = 1
ans.append([1, y])
for i in range(n):
	if i % 2 == 0:
		for j in range(m):
			if matrix[i][j] == 0:
				matrix[i][j] = 1
				ans.append([i + 1, j + 1])
	else:
		for j in range(1, m + 1):
			if matrix[i][-j] == 0:
				matrix[i][-j] = 1
				ans.append([i + 1, m - j + 1])
for i in range(n * m):
	print(' '.join((str(x) for x in ans[i])))


from sys import stdin, stdout
import math, queue, heapq
fastinput = stdin.readline
fastout = stdout.write
t = 1
while t:
	t -= 1
	(n, m, sx, sy) = map(int, fastinput().split())
	visited = []
	visited.append([sx, sy])
	visited.append([1, sy])
	visited.append([1, 1])
	for i in visited:
		print(*i)
	x = 1
	j = 1
	for i in range(1, n + 1):
		while j >= 1 and j <= m:
			if [i, j] in visited:
				j += x
				continue
			else:
				print(i, j)
				j += x
		if j == 0:
			j = 1
		if j == m + 1:
			j = m
		if j == m:
			x = -1
		else:
			x = 1


import sys, math, heapq, collections, itertools, bisect
sys.setrecursionlimit(101000)
(n, m, r, c) = map(int, input().split())
sol = [(r, c), (1, c)]
skip = [(r, c), (1, c)]
(rr, cc, dc) = (1, 1, 1)
while rr <= n:
	while 1 <= cc <= m:
		if (rr, cc) not in skip:
			sol.append((rr, cc))
		cc += dc
	rr += 1
	if dc == 1:
		cc -= 1
		dc = -1
	else:
		cc += 1
		dc = 1
for (r, c) in sol:
	print(r, c)


(n, m, sx, sy) = map(int, input().split())
print(sx, sy)
v = [[1] * (m + 1) for _ in range(n + 1)]
print(1, sy)
v[sx][sy] = 0
v[1][sy] = 0
for i in range(n):
	a = []
	for j in range(m):
		if v[i + 1][j + 1]:
			a.append((i + 1, j + 1))
			v[i + 1][j + 1] = 0
	if i % 2 != 0:
		a.reverse()
	for (x, y) in a:
		print(x, y)


(r, c, i, j) = map(int, input().split())
visit = [[0 for a in range(c)] for b in range(r)]
r -= 1
c -= 1
i -= 1
j -= 1
rama = []
visit[i][j] = 1
visit[0][j] = 1
rama.append([i + 1, j + 1])
rama.append([0 + 1, j + 1])
(a, b) = (0, -1)
while a <= r:
	if a % 2 == 0:
		b += 1
	else:
		b -= 1
	while b <= c and a % 2 == 0:
		if visit[a][b] == 0:
			rama.append([a + 1, b + 1])
		b += 1
	while b >= 0 and a % 2 == 1:
		if visit[a][b] == 0:
			rama.append([a + 1, b + 1])
		b -= 1
	a += 1
for x in rama:
	print(x[0], x[1])


l = [int(x) for x in input().split()]
n = l[0]
m = l[1]
x = l[2]
y = l[3]
ans = []
ans.append((x, y))
ans.append((1, y))
ans.append((1, 1))
visited = {}
visited[str((x, y))] = 1
visited[str((1, y))] = 1
visited[str((1, 1))] = 1
i = 1
while i != n + 1:
	if i % 2 != 0:
		for j in range(1, m + 1):
			if str((i, j)) not in visited:
				ans.append((i, j))
				visited[str((i, j))] = 1
			else:
				continue
		i += 1
	else:
		for j in range(m, 0, -1):
			if str((i, j)) not in visited:
				ans.append((i, j))
				visited[str((i, j))] = 1
			else:
				continue
		i += 1
for i in range(len(ans)):
	print(*ans[i])


import bisect
import copy
import fractions
import heapq
import math
import random
import sys
(n, m, S_x, S_y) = tuple(map(int, input().split()))
print(f'{S_x} {S_y}')
print(f'1 {S_y}')
for x in range(1, n + 1):
	if x % 2 == 1:
		for y in range(1, m + 1):
			if x == 1 and y == S_y or (x == S_x and y == S_y):
				continue
			print(f'{x} {y}')
	else:
		for y in range(m, 0, -1):
			if x == S_x and y == S_y:
				continue
			print(f'{x} {y}')


(n, m, x, y) = map(int, input().split())
ans = [[x, y], [1, y]]
for i in range(1, n + 1):
	if i % 2 == 1:
		for j in range(1, m + 1):
			if (i, j) in [(x, y), (1, y)]:
				continue
			ans.append([i, j])
	else:
		for j in range(m, 0, -1):
			if (i, j) in [(x, y), (1, y)]:
				continue
			ans.append([i, j])
for a in ans:
	print(*a)


import sys
input = sys.stdin.readline
(inp, ip) = (lambda : int(input()), lambda : [int(w) for w in input().split()])
(n, m, x, y) = ip()
a = [(x, y), (1, y), (1, 1)]
dt = {0: range(m, 0, -1), 1: range(1, m + 1)}
for i in range(1, n + 1):
	for j in dt[i % 2]:
		if (i, j) not in a:
			a.append((i, j))
for i in a:
	print(*i)


(n, m, sx, sy) = list(map(int, input().split()))
visited = {(sx, sy), (1, sy)}
print(sx, sy)
print(1, sy)
print(1, 1)
i = 1
j = 2
direction = 1
while i <= n:
	if (i, j) not in visited:
		print(i, j)
	if j == 1 or j == m:
		direction = -direction
		i += 1
		if i > n:
			break
		if (i, j) not in visited:
			print(i, j)
	j += direction


from sys import stdin, stdout

class SOLVE:

	def solve(self):
		R = input
		W = stdout.write
		(n, m, x, y) = [int(x) for x in R().split()]
		ans = [str(x) + ' ' + str(y), '\n', '1' + ' ' + str(y), '\n']
		direction = 'forward'
		for i in range(1, n + 1):
			if direction == 'forward':
				for j in range(1, m + 1):
					if (i, j) != (x, y) and (i, j) != (1, y):
						ans += [str(i) + ' ' + str(j), '\n']
				direction = 'backward'
			else:
				for j in range(m, 0, -1):
					if (i, j) != (x, y) and (i, j) != (1, y):
						ans += [str(i) + ' ' + str(j), '\n']
				direction = 'forward'
		W(''.join(ans))

def main():
	s = SOLVE()
	s.solve()
main()


import sys
read = sys.stdin.readline
(m, n, x, y) = map(int, read().split())
b = [[0] * n for _ in range(m)]
(x, y) = (x - 1, y - 1)
count = 1
b[x][y] = count
count += 1
print(x + 1, y + 1)
x = 0
b[x][y] = count
count += 1
print(x + 1, y + 1)
y = 0
b[x][y] = count
count += 1
print(x + 1, y + 1)
step = 1
while (x != m - 1 or y != n - 1) or (x != m - 1 or y != 0):
	if y + step >= n or y + step < 0:
		x += 1
		if x > m - 1:
			break
		b[x][y] = count
		count += 1
		print(x + 1, y + 1)
		step *= -1
	y += step
	if b[x][y] != 0:
		y += step
	b[x][y] = count
	count += 1
	print(x + 1, y + 1)


(n, m, x, y) = map(int, input().strip().split(' '))
ans = []
p = 0
visited = [[False for i in range(m + 1)] for j in range(n + 1)]
ans.append([x, y])
visited[x][y] = True
x = 1
ans.append([x, y])
visited[x][y] = True
y = 1
ans.append([x, y])
visited[x][y] = True
for f in range(n):
	if f % 2 == 0:
		while y <= m:
			if not visited[x][y]:
				ans.append([x, y])
			y += 1
		y -= 1
	else:
		while y >= 1:
			if not visited[x][y]:
				ans.append([x, y])
			y -= 1
		y += 1
	x += 1
for (a, b) in ans:
	print(a, b)


(row, column, ii, jj) = map(int, input().split())
a = [[0 for i in range(column)] for j in range(row)]
a[ii - 1][jj - 1] = 1
print(ii, jj)
a[0][jj - 1] = 1
print(1, jj)
a[0][0] = 1
print(1, 1)
for i in range(0, row):
	if i % 2 != 0:
		k = column - 1
	for j in range(0, column):
		if i % 2 != 0:
			if a[i][k - j] == 0:
				print(i + 1, k - j + 1)
				a[i][k - j] = 1
		elif a[i][j] == 0:
			print(i + 1, j + 1)
			a[i][j] = 1


(a, b, c, d) = map(int, input().split())
print(c, d)
print(1, d)
for i in range(1, a + 1):
	if i & 1:
		for j in range(1, b + 1):
			if (i == c or i == 1) and j == d:
				continue
			else:
				print(i, j)
	else:
		for j in reversed(range(1, b + 1)):
			if (i == c or i == 1) and j == d:
				continue
			else:
				print(i, j)


import sys, threading
sys.setrecursionlimit(10 ** 8)
threading.stack_size(10 ** 8)

def main():
	(n, m, si, sj) = map(int, input().split())
	print(si, sj)
	print(1, sj)
	for i in range(0, n):
		for j in range(0, m) if i % 2 == 0 else reversed(range(0, m)):
			if (i, j) not in [(si - 1, sj - 1), (0, sj - 1)]:
				print(i + 1, j + 1)
threading.Thread(target=main).start()


(n, m, sx, sy) = map(int, input().split())
route = [(sx - 1, sy - 1), (0, sy - 1), (0, 0)]
(i, j) = (0, 0)
dir = 1
while True:
	j += dir
	if (i, j) != (0, sy - 1) and (i, j) != (sx - 1, sy - 1):
		route.append((i, j))
	if j == 0 or j == m - 1:
		dir *= -1
		i += 1
		route.append((i, j))
	if i != n:
		continue
	if n % 2 == 0 and j == 0:
		break
	if n % 2 != 0 and j == m - 1:
		break
for r in route[:len(route) - 1]:
	print(r[0] + 1, r[1] + 1)


(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, s_x, s_y) = [int(i) for i in input().split()]
print(s_x, s_y)
print(1, s_y)
print(1, 1)
for i in range(1, n + 1):
	for j in range(1, m + 1):
		if i % 2 == 1:
			a = i
			b = j
		else:
			a = i
			b = m + 1 - j
		if [a, b] != [s_x, s_y] and [a, b] != [1, s_y] and ([a, b] != [1, 1]):
			print(a, b)


(n, m, sx, sy) = [int(x) for x in input().strip().split()]
print(sx, sy)
print(1, sy)
print(1, 1)
visited = {(1, 1), (1, sy), (sx, sy)}
down = True
for i in range(1, n + 1):
	if down:
		for j in range(1, m + 1):
			if not (i, j) in visited:
				print(i, j)
	else:
		for j in range(m, 0, -1):
			if not (i, j) in visited:
				print(i, j)
	down = not down


(n, m, x, y) = list(map(int, input().split()))
i = x
j = y
dont = []
dont.append([x, y])
print('{} {}'.format(x, y))
if not [1, y] in dont:
	print('{} {}'.format(1, y))
	dont.append([1, y])
if not [1, 1] in dont:
	print('{} {}'.format(1, 1))
	dont.append([1, 1])
flag = 0
for i in range(1, n + 1):
	if flag == 0:
		for j in range(1, m + 1):
			if not [i, j] in dont:
				print('{} {}'.format(i, j))
		flag = 1 - flag
	else:
		for j in range(m, 0, -1):
			if not [i, j] in dont:
				print('{} {}'.format(i, j))
		flag = 1 - flag


import sys, math, cmath, time
start_time = time.time()

def solve():
	(n, m, x, y) = invr()
	q = [[0] * m for i in range(n)]
	a = [str(x) + ' ' + str(y), '1 ' + str(y), '1 1']
	qw = [str(x) + ' ' + str(y), '1 ' + str(y), '1 1']
	for i in range(n):
		for j in range(m):
			if i % 2 == 0:
				w = str(i + 1) + ' ' + str(j + 1)
			else:
				w = str(i + 1) + ' ' + str(m - j)
			if w not in qw:
				a.append(w)
	print(*a, sep='\n')

def main():
	global tt
	if not ONLINE_JUDGE:
		sys.stdin = open('input.txt', 'r')
		sys.stdout = open('output.txt', 'w')
	t = 1
	for tt in range(t):
		solve()
	if not ONLINE_JUDGE:
		print('Time Elapsed :', time.time() - start_time, 'seconds')
		sys.stdout.close()

def inp():
	return int(input())

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

def insr():
	return input().strip()

def invr():
	return map(int, input().split())

def counter(a):
	q = [0] * max(a)
	for i in range(len(a)):
		q[a[i] - 1] = q[a[i] - 1] + 1
	return q

def counter_elements(a):
	q = dict()
	for i in range(len(a)):
		if a[i] not in q:
			q[a[i]] = 0
		q[a[i]] = q[a[i]] + 1
	return q

def string_counter(a):
	q = [0] * 26
	for i in range(len(a)):
		q[ord(a[i]) - 97] = (q[ord(a[i]) - 97], 1)
	return q

def factors(n):
	q = []
	for i in range(1, int(n ** 0.5) + 1):
		if n % i == 0:
			q.append(i)
			q.append(n // i)
	return list(sorted(list(set(q))))

def prime_factors(n):
	q = []
	while n % 2 == 0:
		q.append(2)
		n = n // 2
	for i in range(3, int(n ** 0.5) + 1, 2):
		while n % i == 0:
			q.append(i)
			n = n // i
	if n > 2:
		q.append(n)
	return list(sorted(q))

def transpose(a):
	(n, m) = (len(a), len(a[0]))
	b = [[0] * n for i in range(m)]
	for i in range(m):
		for j in range(n):
			b[i][j] = a[j][i]
	return b

def factorial(n, m=1000000007):
	q = 1
	for i in range(n):
		q = q * (i + 1) % 1000000007
	return q
ONLINE_JUDGE = __debug__
if ONLINE_JUDGE:
	input = sys.stdin.readline
main()


[n, m, x, y] = [int(p) for p in input().split()]
print('{x1} {y1}'.format(x1=x, y1=y))
print('{x1} {y1}'.format(x1=1, y1=y))
for i in range(1, n + 1):
	if i % 2 == 1:
		for j in range(1, m + 1):
			if i == 1 and j == y:
				continue
			elif i == x and j == y:
				continue
			else:
				print('{x1} {y1}'.format(x1=i, y1=j))
	else:
		for j in range(m, 0, -1):
			if i == x and j == y:
				continue
			else:
				print('{x1} {y1}'.format(x1=i, y1=j))


(n, m, x, y) = map(int, input().split())
print(x, y)
print(1, y)
print(1, 1)
l = [(x, y), (1, y), (1, 1)]
for i in range(1, n + 1, 2):
	for j in range(1, m + 1):
		if (i, j) not in l:
			print(i, j)
	if i + 1 <= n:
		for j in range(m, 0, -1):
			if (i + 1, j) not in l:
				print(i + 1, j)


(n, m, sx, sy) = map(int, input().split())
from collections import *
al = defaultdict(tuple)
ans = [[sx, sy], [1, sy], [1, 1]]
for i in range(1, n + 1):
	for j in range(1, m + 1):
		if i % 2 == 0:
			if [i, m - j + 1] != [1, 1] and [i, m - j + 1] != [sx, sy] and ([i, m - j + 1] != [1, sy]):
				ans.append([i, m - j + 1])
		elif [i, j] != [1, 1] and [i, j] != [sx, sy] and ([i, j] != [1, sy]):
			ans.append([i, j])
for i in range(len(ans)):
	print(ans[i][0], ans[i][1])


(n, m, x, y) = map(int, input().split())
l = []
print(x, y)
print(1, y)
print(1, 1)
l.append([x, y])
l.append([1, y])
l.append([1, 1])
x = y = 1
for z in range(n):
	if y == m and x <= n:
		x = x + 1
		for i in range(m):
			if [x, y] not in l:
				print(x, y)
			y = y - 1
		y += 1
		x += 1
	elif y == 1 and x <= n:
		for i in range(m):
			if [x, y] not in l:
				print(x, y)
			y += 1
		y -= 1


(n, m, r, c) = list(map(int, input().split(' ')))
(s_x, s_y) = (r, c)
cnt = 0
print(r, c)
cnt += 1
(r, c) = (1, c)
print(r, c)
cnt += 1
(r, c) = (1, 1)
print(r, c)
cnt += 1
while cnt <= n * m:
	while c + 1 <= m:
		c += 1
		if r == 1:
			if c != 1 and c != s_y:
				print(r, c)
				cnt += 1
		elif r == s_x:
			if c != s_y:
				print(r, c)
				cnt += 1
		else:
			print(r, c)
			cnt += 1
	if r + 1 <= n:
		r += 1
	else:
		break
	c += 1
	while c - 1 >= 1:
		c -= 1
		if r == 1:
			if c != 1 and c != s_y:
				print(r, c)
				cnt += 1
		elif r == s_x:
			if c != s_y:
				print(r, c)
				cnt += 1
		else:
			print(r, c)
			cnt += 1
	if r + 1 <= n:
		r += 1
	else:
		break
	c -= 1


(n, m, x, y) = map(int, input().split())
(a, b) = (1, 2)
print(x, y)
print(1, y)
print(1, 1)
while a <= n:
	while b <= m:
		if (a, b) != (1, y) and (a, b) != (x, y):
			print(a, b)
		b += 1
	a += 1
	b -= 1
	if a <= n:
		while b >= 1:
			if (a, b) != (1, y) and (a, b) != (x, y):
				print(a, b)
			b -= 1
		b += 1
		a += 1


(n, m, sx, sy) = map(int, input().split())
arr = [[sx, sy], [1, sy], [1, 1]]
k = True
for i in range(1, n + 1):
	for j in range(1, m + 1):
		if k:
			if [i, j] != [sx, sy] and [i, j] != [1, sy] and ([i, j] != [1, 1]):
				arr.append([i, j])
		elif [i, m + 1 - j] != [sx, sy] and [i, j] != [1, sy] and ([i, j] != [1, 1]):
			arr.append([i, m + 1 - j])
	if k == True:
		k = False
	else:
		k = True
for i in arr:
	s = map(str, i)
	si = ' '.join(s)
	print(si)


(n, m, x, y) = map(int, input().split())
print(x, y)
print(1, y)
for i in range(1, m + 1):
	if i != y:
		print(1, i)
for i in range(2, n + 1):
	if i % 2 == 0:
		yy = m
		while yy > 0:
			if not (i == x and yy == y):
				print(i, yy)
			yy -= 1
	else:
		yy = 1
		while yy <= m:
			if not (i == x and yy == y):
				print(i, yy)
			yy += 1


s = input()
(n, m, x, y) = [int(i) for i in s.split(' ')]
print(x, y)
(tx, ty) = (1, y)
if (tx, ty) != (x, y):
	print(tx, ty)
for cs in range(1, n + 1, 2):
	for ys in range(1, m + 1):
		if (cs, ys) != (tx, ty) and (cs, ys) != (x, y):
			print(cs, ys)
	cs += 1
	if cs > n:
		continue
	for ys in range(m, 0, -1):
		if (cs, ys) != (tx, ty) and (cs, ys) != (x, y):
			print(cs, ys)


(n, m, sx, sy) = list(map(int, input().split()))
print(sx, sy)
print(1, sy)
for i in range(1, n + 1):
	l = []
	for j in range(1, m + 1):
		if i == sx and j == sy:
			continue
		elif i == 1 and j == sy:
			continue
		elif i % 2 != 0:
			print('%d %d' % (i, j))
		elif i % 2 == 0:
			co = 0
			while m >= 1:
				if i == sx and m == sy:
					m -= 1
					co += 1
					continue
				else:
					print(i, m)
					m -= 1
					co += 1
			m = co
			break


(n, m, y, x) = map(int, input().split())
ans = []
ans.append((y, x))
ans.append((1, x))
for i in range(1, n + 1):
	if i & 1:
		for j in range(1, m + 1):
			if i == y and j == x or (i == 1 and j == x):
				continue
			ans.append((i, j))
	else:
		for j in range(m, 0, -1):
			if i == y and j == x or (i == 1 and j == x):
				continue
			ans.append((i, j))
for i in ans:
	print(*i)


(n, m, x, y) = map(int, input().split())
print(x, y)
print(1, y)
for r in range(1, n + 1):
	if r % 2 == 1:
		for c in range(1, m + 1):
			if r == 1 and c == y:
				continue
			if r == x and c == y:
				continue
			print(r, c)
	else:
		for c in range(m, 0, -1):
			if r == x and c == y:
				continue
			print(r, c)


def solve(n, m, sx, sy):
	print(sx, sy)
	print(1, sy)
	for x in range(1, n + 1):
		for i in range(1, m + 1):
			if x % 2 == 1:
				y = i
			else:
				y = m - i + 1
			if (x, y) == (1, sy):
				continue
			if (x, y) == (sx, sy):
				continue
			print(x, y)
(n, m, sx, sy) = [int(x) for x in input().split()]
solve(n, m, sx, sy)


(n, m, x, y) = list(map(int, input().split()))
point = []
for i in range(1, n + 1):
	if i & 1:
		for j in range(1, m + 1):
			point.append((i, j))
	else:
		for j in range(m, 0, -1):
			point.append((i, j))
point.remove((1, 1))
point.remove((1, y))
point.remove((x, y))
point.insert(0, (1, 1))
point.insert(0, (1, y))
point.insert(0, (x, y))
for i in point:
	print(*i)


(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


def solve(n, m, x, y):
	avoid = [[x, y], [1, y]]
	print(x, y)
	print(1, y)
	for i in range(1, n + 1):
		if i % 2 == 1:
			for j in range(1, m + 1):
				cell = [i, j]
				if cell not in avoid:
					print(i, j)
		else:
			for j in range(m, 0, -1):
				cell = [i, j]
				if cell not in avoid:
					print(i, j)
(n, m, x, y) = map(int, input().split())
solve(n, m, x, y)


(n, m, x, y) = map(int, input().split())
anz = [[x, y], [1, y]]
d = {(x, y): 1, (1, y): 1}
for i in range(1, n + 1):
	if i & 1:
		for j in range(1, m + 1):
			if (i, j) not in d:
				anz.append([i, j])
				d[i, j] = 1
	else:
		for j in range(m, 0, -1):
			if (i, j) not in d:
				anz.append([i, j])
				d[i, j] = 1
for i in anz:
	print(*i)


import math
import sys
import bisect
input = sys.stdin.readline
t = 1
for _ in range(t):
	(n, m, x, y) = map(int, input().split())
	vis = [[0 for j in range(m + 1)] for i in range(n + 1)]
	print(x, y)
	vis[x][y] = 1
	print(1, y)
	vis[1][y] = 1
	ch = 0
	for i in range(1, n + 1):
		if ch % 2 == 0:
			for j in range(1, m + 1):
				if vis[i][j] == 0:
					print(i, j)
					vis[i][j] = 1
			ch += 1
		else:
			for j in range(m, 0, -1):
				if vis[i][j] == 0:
					print(i, j)
					vis[i][j] = 1
			ch += 1


(n, m, sx, sy) = map(int, input().split())
sx -= 1
sy -= 1
path = []
path.append((sx, sy))
path.append((0, sy))
for i in range(n):
	for j in range(m):
		cell = (i, j) if i % 2 == 0 else (i, m - j - 1)
		if cell != (sx, sy) and cell != (0, sy):
			path.append(cell)
for cell in path:
	print(cell[0] + 1, cell[1] + 1)


l = input().split()
n = int(l[0])
m = int(l[1])
x = int(l[2])
y = int(l[3])
hashi = dict()
hashi[x, y] = 1
print(x, y)
print(1, y)
hashi[1, y] = 1
curr = 0
for i in range(1, n + 1):
	if curr == 0:
		for j in range(1, m + 1):
			if (i, j) not in hashi:
				print(i, j)
		curr = 1
	else:
		for j in range(m, 0, -1):
			if (i, j) not in hashi:
				print(i, j)
		curr = 0


(n, m, x, y) = [int(x) for x in input().split()]
print('{} {}'.format(x, y))
print('1 {}'.format(y))
for i in range(1, n + 1, 2):
	for j in range(1, m + 1):
		if j == y and i in [1, x]:
			continue
		print('{} {}'.format(i, j))
	for j in range(m, 0, -1):
		if i == n:
			break
		if j == y and i + 1 in [1, x]:
			continue
		print('{} {}'.format(i + 1, j))


(n, m, sx, sy) = [int(x) for x in input().split()]
print(sx, sy)
print(1, sy)
a = [[sx, sy], [1, sy]]
for i in range(1, n + 1):
	if i % 2 == 1:
		for j in range(1, m + 1):
			if [i, j] not in a:
				print(i, j)
	if i % 2 == 0:
		for j in range(m, 0, -1):
			if [i, j] not in a:
				print(i, j)


(n, m, p, q) = map(int, input().split())
d = dict()
a = [[p, q]]
a.append([1, q])
a.append([1, 1])
for i in range(1, n + 1):
	if i % 2 != 0:
		j = 1
		while j <= m:
			if i == 1 and j == 1:
				pass
			elif i == 1 and j == q:
				pass
			elif i == p and j == q:
				pass
			else:
				a.append([i, j])
			j += 1
	else:
		j = m
		while j >= 1:
			if i == 1 and j == 1:
				pass
			elif i == 1 and j == q:
				pass
			elif i == p and j == q:
				pass
			else:
				a.append([i, j])
			j += -1
for j in a:
	print(*j)


import sys
input = sys.stdin.readline
(n, m, x, y) = map(int, input().split())
ans = [(x, y), (1, y)]
for i in range(1, n + 1):
	for j in range(1, m + 1):
		if i % 2 == 1 and (not ((i, j) == (x, y) or (i, j) == (1, y))):
			ans.append((i, j))
		elif i % 2 == 0 and (not (i, m - j + 1) == (x, y)):
			ans.append((i, m - j + 1))
for (x, y) in ans:
	print(x, y)


(n, m, x, y) = map(int, input().split())
visited = [[False for i in range(m + 1)] for j in range(n + 1)]
visited[x][y] = True
print(x, y)
print(1, y)
visited[1][y] = True
for row in range(1, n + 1):
	if row % 2 == 1:
		for col in range(1, m + 1):
			if visited[row][col] is False:
				print(row, col)
	else:
		for col in range(m, 0, -1):
			if visited[row][col] is False:
				print(row, col)


(n, m, r, s) = map(int, input().split())
s1 = [r, s]
print(r, s)
if r != 1:
	a = 1
	b = s
	print(1, s)
if r != 1 and s != 1:
	c = 1
	d = 1
	print(1, 1)
i = j = 1
for i in range(1, n + 1):
	if i % 2 != 0:
		for j in range(1, m + 1):
			if i == r and j == s:
				continue
			if i == 1 and j == 1:
				continue
			elif i == a and j == b:
				continue
			elif i == c and j == d:
				continue
			else:
				print(i, j)
	else:
		for j in range(m, 0, -1):
			if i == r and j == s:
				continue
			if i == 1 and j == 1:
				continue
			elif i == a and j == b:
				continue
			elif i == c and j == d:
				continue
			else:
				print(i, j)


(a, b, c, d) = map(int, input().split())
print(c, d)
if c != 1:
	f = 0
	print(1, d)
	if d != 1:
		print(1, 1)
elif d != 1:
	f = 1
	print(c, 1)
	if c != 1:
		print(1, 1)
for i in range(1, a + 1):
	if i % 2 == 0:
		for j in range(b, 0, -1):
			x = i
			y = j
			if f == 0:
				if x == 1 and y == 1:
					pass
				elif x == 1 and y == d:
					pass
				elif x == c and y == d:
					pass
				else:
					print(x, y)
			if f == 1:
				if x == 1 and y == 1:
					pass
				elif x == c and y == 1:
					pass
				elif x == c and y == d:
					pass
				else:
					print(x, y)
	else:
		for j in range(1, b + 1):
			x = i
			y = j
			if f == 0:
				if x == 1 and y == 1:
					pass
				elif x == 1 and y == d:
					pass
				elif x == c and y == d:
					pass
				else:
					print(x, y)
			if f == 1:
				if x == 1 and y == 1:
					pass
				elif x == c and y == 1:
					pass
				elif x == c and y == d:
					pass
				else:
					print(x, y)