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

public class broadcast_dk_wa {
	BufferedReader br;
	PrintWriter out;
	StringTokenizer stok;

	String nextToken() throws IOException {
		while (stok == null || !stok.hasMoreTokens()) {
			String s = br.readLine();
			if (s == null) {
				return null;
			}
			stok = new StringTokenizer(s);
		}
		return stok.nextToken();
	}

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

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

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

	char nextChar() throws IOException {
		return (char) (br.read());
	}

	String nextLine() throws IOException {
		return br.readLine();
	}
	
	class Pos {
		int i, j, t;

		public Pos(int i, int j, int t) {
			super();
			this.i = i;
			this.j = j;
			this.t = t;
		}

	}
	int[] ldx, ldy, rux, ruy;
	
	boolean inRect(int x, int y, int i) {
		if (i == 0) return false;
		return (x > ldx[i] && x <= rux[i] && y >= ldy[i] && y <= ruy[i]);
	}
	
	int n, m;
	boolean inField(int x, int y){
		return (x >= 0 && x < n && y >= 0 && y < m);
	}
	void solve() throws IOException {
		n = nextInt();
		m = nextInt();
		int k = nextInt();
		boolean[][] f = new boolean[n][m];
		byte[][][] prev = new byte[n][m][k+1];
		Queue<Pos> queue = new ArrayDeque<Pos>();
		//init
		for (int i = 0; i < n; i++) {
			for (int j = 0; j <  m; j++) {
				queue.add(new Pos(i, j, 0 ));
			}
		}
		ldx = new int[k+1];
		ldy = new int[k+1];
		rux = new int[k+1];
		ruy = new int[k+1];
		for (int i = 1; i < k + 1; i++) {
			ldx[i] = nextInt() - 1;
			ldy[i] = nextInt() - 1;
			rux[i] = nextInt() - 1;
			ruy[i] = nextInt() - 1;
		}
		int[] dx = {0, 1, 0, -1};
		int[] dy = {1, 0, -1, 0};
		
		for (int i = 1; i < k + 1; i++) {
			for (int ii = 0; ii < n; ii++) {
				for (int j = 0; j < m; j++) {
					f[ii][j] = false;
				}
			}
			while (queue.size() != 0 && queue.peek().t == (i - 1)) {
				int x2 = queue.peek().i;
				int y2 = queue.peek().j;
				queue.poll();
				for (byte v = 0; v < 4; v++) {
					if (inField(x2 + dx[v], y2 + dy[v]) && f[x2 + dx[v]][y2 + dy[v]] == false && !inRect(x2 + dx[v], y2 + dy[v], i)) {
						f[x2 + dx[v]][y2 + dy[v]] = true;
						prev[x2 + dx[v]][y2 + dy[v]][i] = (byte) ((v + 2) % 4);
						queue.add(new Pos(x2 + dx[v], y2 + dy[v], i));
						//System.err.println((x2 + dx[v]) + " " + (y2 + dy[v]) + " " + i);
					}
				}
			}
		}
		if (queue.size() == 0) {
			out.println("Impossible");
			return;
		}
		Stack<Pos> stack = new Stack<Pos>();
		stack.add(queue.peek());
		//System.err.println(stack.peek().i + " " + stack.peek().j);
		fort: for (int i = k - 1; i >= 0; i--) {
			//System.err.println(stack.peek().i + " " + stack.peek().j);
			for (int v = 0; v < 4; v++) {
				int x2 = stack.peek().i + dx[ prev[stack.peek().i][stack.peek().j][i + 1] ];
				int y2 = stack.peek().j + dy[ prev[stack.peek().i][stack.peek().j][i + 1] ];
				if (inField(x2, y2) && !inRect(x2, y2, i)) {
					stack.add(new Pos(x2, y2, i));
					continue fort;
				} else {
					System.err.println("=(");
				}
			}
		}
		stack.pop();
		while (!stack.isEmpty()) {
			out.println((stack.peek().i + 1) + " " + (stack.peek().j + 1));
			stack.pop();
		}
 	}

	void run() throws IOException {
		br = new BufferedReader(new FileReader("broadcast.in"));
		out = new PrintWriter("broadcast.out");
		// br = new BufferedReader(new FileReader("input.txt"));
		// out = new PrintWriter("output.txt");
		// br = new BufferedReader(new InputStreamReader(System.in));
		// out = new PrintWriter(System.out);
		solve();
		br.close();
		out.close();
	}

	public static void main(String[] args) throws IOException {
		// Localea.setDefault(Locale.US);
		new broadcast_dk_wa().run();
	}
}