import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.BufferedWriter;
import java.util.InputMismatchException;
import java.io.FileOutputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.FileInputStream;
import java.util.NoSuchElementException;
import java.io.Writer;
import java.math.BigInteger;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 * @author Alex
 */
public class Main {
	public static void main(String[] args) {
		InputStream inputStream;
		try {
			inputStream = new FileInputStream("input.txt");
		} catch (IOException e) {
			throw new RuntimeException(e);
		}
		OutputStream outputStream;
		try {
			outputStream = new FileOutputStream("output.txt");
		} catch (IOException e) {
			throw new RuntimeException(e);
		}
		InputReader in = new InputReader(inputStream);
		OutputWriter out = new OutputWriter(outputStream);
		TaskC solver = new TaskC();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskC {
    public void solve(int testNumber, InputReader in, OutputWriter out) {
	    int maxdist = -1, maxrow = -1, maxcol = -1;
	    int rows = in.ri(), cols = in.ri();
	    int k = in.ri();
	    IntPair[] points = new IntPair[k];
	    for(int i = 0; i < k; i++) points[i] = new IntPair(in.ri(), in.ri());
	    for(int row = 1; row <= rows; row++) {
		    for(int col = 1; col <= cols; col++) {
			    int mindist = Integer.MAX_VALUE;
			    for(int i = 0; i < k; i++)
				    mindist = Math.min(mindist, Math.abs(row - points[i].first) + Math.abs(col - points[i].second));
			    if (mindist > maxdist){
				    maxdist = mindist;
				    maxrow = row;
				    maxcol = col;
			    }
		    }
	    }
	    out.printLine(maxrow, maxcol);
    }
}

class InputReader {
	private InputStream stream;
	private byte[] buf = new byte[1024];
	private int curChar;
	private int numChars;
	private SpaceCharFilter filter;

	public InputReader(InputStream stream) {
		this.stream = stream;
	}

	public int read() {
		if (numChars... What is the time complexity of the previous code?