import java.io.*;
import java.util.*;

public class broadcast_av {

	final String filename = new String("broadcast").toLowerCase();

	final int[] dx = new int[] { -1, 1, 0, 0 };
	final int[] dy = new int[] { 0, 0, 1, -1 };

	boolean inside(int cx, int cy, int leftX, int leftY, int rightX, int rightY) {
		return cx >= leftX && cx <= rightX && cy >= leftY && cy <= rightY;
	}

	void solve() throws Exception {
		int w = nextInt(), h = nextInt();
		int n = nextInt();
		boolean[][][] can = new boolean[n][w][h];

		for (int i = 0; i < n; i++) {
			int ax = nextInt() - 1, ay = nextInt() - 1;
			int bx = nextInt() - 1, by = nextInt() - 1;

			for (int x = 0; x < w; x++) {
				for (int y = 0; y < h; y++) {
					if (inside(x, y, ax, ay, bx, by)) {
						continue;
					}
					if (i == 0) {
						can[i][x][y] = true;
						continue;
					}
					for (int k = 0; k < 4; k++) {
						int cx = x + dx[k];
						int cy = y + dy[k];
						if (inside(cx, cy, 0, 0, w - 1, h - 1) && can[i - 1][cx][cy]) {
							can[i][x][y] = true;
							break;
						}
					}
				}
			}
		}

		int lastX = -1, lastY = -1;
		for (int x = 0; x < w; x++) {
			for (int y = 0; y < h; y++) {
				if (can[n - 1][x][y]) {
					lastX = x;
					lastY = y;
				}
			}
		}

		if (lastX == -1) {
			out.println("Impossible");
			return;
		}

		List<Integer> ansX = new ArrayList<Integer>(), ansY = new ArrayList<Integer>();
		for (int i = n - 1; i >= 0; i--) {
			ansX.add(lastX);
			ansY.add(lastY);
			if (i == 0) {
				break;
			}
			for (int k = 0; k < 4; k++) {
				int cx = lastX + dx[k];
				int cy = lastY + dy[k];
				if (inside(cx, cy, 0, 0, w - 1, h - 1) && can[i - 1][cx][cy]) {
					lastX = cx;
					lastY = cy;
					break;
				}
			}
		}
		for (int i = n - 1; i >= 0; i--) {
			out.println((ansX.get(i) + 1) + " " + (ansY.get(i) + 1));
		}
	}

	void run() {
		try {
			in = new BufferedReader(new FileReader(filename + ".in"));
			out = new PrintWriter(filename + ".out");
			// in = new BufferedReader(new InputStreamReader(System.in));
			// out = new PrintWriter(System.out);

			solve();

			out.close();
		} catch (Exception e) {
			e.printStackTrace();
			System.exit(1);
		}
	}

	BufferedReader in;
	StringTokenizer st;
	PrintWriter out;

	String nextToken() throws Exception {
		while (st == null || !st.hasMoreTokens())
			st = new StringTokenizer(in.readLine());
		return st.nextToken();
	}

	int nextInt() throws Exception {
		return Integer.parseInt(nextToken());
	}

	long nextLong() throws Exception {
		return Long.parseLong(nextToken());
	}

	double nextDouble() throws Exception {
		return Double.parseDouble(nextToken());
	}

	public static void main(String[] args) {
		new broadcast_av().run();
	}

}
