import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Deque;
import java.util.HashMap;
import java.util.Map;
import java.util.PriorityQueue;
import java.util.Queue;
import java.util.StringTokenizer;
import java.util.Vector;

public class broadcast_nk implements Runnable {

	private String nextToken() {
		if (st1 == null || !st1.hasMoreTokens()) {
			try {
				String p = in.readLine();
				if (p == null) {
					return null;
				}
				st1 = new StringTokenizer(p);
			} catch (IOException e) {
				e.printStackTrace();
			}
		}
		return st1.nextToken();
	}

	private int nextInt() {
		return new Integer(nextToken());
	}

	private long nextLong() {
		return new Long(nextToken());
	}

	private StringTokenizer st1;
	private BufferedReader in;
	private PrintWriter out;

	public class rect{
		int x1;
		int y1;
		int x2;
		int y2;
		rect(int a, int b,int c, int d){
			x1 = a;
			y1 = b;
			x2 = c;
			y2 = d;
		}
	}
	
	public class point{
		int x;
		int y;
		int t;
		point(int a, int b, int c){
			x = a;
			y = b;
			t = c;
		}
	}

	int h;
	int w;
	int[] pr;
	ArrayList<point> q;
	public void ans(int a){
		if (pr[a] != -1){
			ans(pr[a]);
		}
		out.println(q.get(a).x + " " + q.get(a).y);

	}
	
	public boolean check(rect r, point p){
		return ((p.x < r.x1 || p.y < r.y1 || p.x > r.x2 || p.y > r.y2) && (p.x >= 1 && p.y >= 1 && p.x <= h && p.y <= w));
	}
	
	@Override
	public void run() {
		try {
			in = new BufferedReader(new FileReader("broadcast.in"));
			out = new PrintWriter(new FileWriter("broadcast.out"));
			// in = new BufferedReader(new InputStreamReader(System.in));
			// out = new PrintWriter(System.out);
			h = nextInt();
			w = nextInt();
			int n = nextInt();
			rect[] a = new rect[n];
			for (int i = 0; i<n;i++){
				a[i] = new rect(nextInt(), nextInt(), nextInt(), nextInt());
			}
			q = new ArrayList<point>();
			for (int i = 1; i<=h;i++){
				for (int j = 1; j<=w; j++){
					if (check(a[0], new point(i , j , 1)))
						q.add(new point(i , j , 1));
				}
			}
			boolean[][][] f = new boolean[h + 1][w + 1][n + 2];
			pr = new int[w*h*n + 1];
			Arrays.fill(pr, -1);
			int head = 0;
			int answer = -1;
			while (head <= q.size()){
				if (q.get(head).t >= n) 
					break;
				point p = q.get(head);
				head++;
				int s = head - 1;
				if (p.t == n - 1)
					answer = head;
				if (check(a[p.t], new point(p.x + 1, p.y, 0)) && !f[p.x + 1][p.y][p.t + 1]){
					f[p.x + 1][p.y][p.t + 1] = true;
					q.add(new point(p.x + 1, p.y, p.t + 1));
					pr[q.size() - 1] = s; 
				}
				if (check(a[p.t], new point(p.x, p.y + 1, 0)) && !f[p.x][p.y + 1][p.t + 1]){
					f[p.x][p.y + 1][p.t + 1] = true;
					q.add(new point(p.x, p.y + 1, p.t + 1));
					pr[q.size() - 1] = s;
				}
				if (check(a[p.t], new point(p.x - 1, p.y, 0)) && !f[p.x - 1][p.y][p.t + 1]){
					f[p.x - 1][p.y][p.t + 1] = true;
					q.add(new point(p.x - 1, p.y, p.t + 1));
					pr[q.size() - 1] = s;
				}
				if (check(a[p.t], new point(p.x , p.y - 1, 0)) && !f[p.x][p.y - 1][p.t + 1]){
					f[p.x][p.y - 1][p.t + 1] = true;
					q.add(new point(p.x, p.y - 1, p.t + 1));
					pr[q.size() - 1] = s;
				}
				
			}
			if (answer == -1){
				out.print("Impossible");
			}
			else ans(answer);
			in.close();
			out.close();
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

	}

	public static void main(String[] args) {
		new Thread(new broadcast_nk()).start();
	}

}