#include <iostream>
#include <fstream>
#include <vector>

using namespace std;

const int DX[4] = {0, 0, 1, -1};
const int DY[4] = {1, -1, 0, 0};

int h, w, n;

bool inside(int a, int b, int c)
{
    return a <= b && b < c;
}

bool inBounds(int x, int y)
{
    return inside(0, x, h) && inside(0, y, w);
}

int main()
{
    ifstream in("broadcast.in");
    ofstream out("broadcast.out");
    in >> h >> w >> n;
    vector<vector<vector<bool> > > used(n + 1, vector<vector<bool> >(h, vector<bool>(w)));
    vector<size_t> x1(n), x2(n), y1(n), y2(n);
    for (int i = 0; i < n; i++)
    {
        in >> x1[i] >> y1[i] >> x2[i] >> y2[i];
        x1[i]--;
        y1[i]--;
    }
    for (int i = 0; i < h; i++)
        for (int j = 0; j < w; j++)
            used[0][i][j] = true;
    for (int k = 0; k < n; k++)
    {
        for (int i = 0; i < h; i++)
        {
            for (int j = 0; j < w; j++)
            {
                if (!used[k][i][j])
                    continue;
                for (size_t d = 0; d < 4; d++)
                {
                    int toX = i + DX[d];
                    int toY = j + DY[d];
                    if (inBounds(toX, toY) && (!inside(x1[k], toX, x2[k]) ||
                                !inside(y1[k], toY, y2[k])))
                    {
                        used[k + 1][toX][toY] = true;
                    }
                }
            }
        }
    }
    vector<int> xAns, yAns;
    int nowX = -1, nowY = -1;
    for (int i = 0; i < h; i++)
        for (int j = 0; j < w; j++)
            if (used[n][i][j])
            {
                nowX = i;
                nowY = j;
            }
    if (nowX == -1)
    {
        out << "Impossible" << endl;
        return 0;
    }
    for (int i = n - 1; i >= 0; i--)
    {
        xAns.push_back(nowX);
        yAns.push_back(nowY);
        for (size_t d = 0; d < 4; d++)
        {
            int xTo = nowX + DX[d];
            int yTo = nowY + DY[d];
            if (inBounds(xTo, yTo) && used[i][xTo][yTo])
            {
                nowX = xTo;
                nowY = yTo;
                break;
            }
        }
    }
    for (int i = n - 1; i >= 0; i--)
        out << (xAns[i] + 1) << " " << (yAns[i] + 1) << endl;
}
