Problem: After a terrifying forest fire in Berland a forest rebirth program was carried out. Due to it N rows with M trees each were planted and the rows were so neat that one could map it on a system of coordinates so that the j-th tree in the i-th row would have the coordinates of (i, j). However a terrible thing happened and the young forest caught fire. Now we must find the coordinates of the tree that will catch fire last to plan evacuation.

The burning began in K points simultaneously, which means that initially K trees started to burn. Every minute the fire gets from the burning trees to the ones that aren’t burning and that the distance from them to the nearest burning tree equals to 1.

Find the tree that will be the last to start burning. If there are several such trees, output any.

Input

The first input line contains two integers N, M (1 ≤ N, M ≤ 2000) — the size of the forest. The trees were planted in all points of the (x, y) (1 ≤ x ≤ N, 1 ≤ y ≤ M) type, x and y are integers.

The second line contains an integer K (1 ≤ K ≤ 10) — amount of trees, burning in the beginning. 

The third line contains K pairs of integers: x1, y1, x2, y2, ..., xk, yk (1 ≤ xi ≤ N, 1 ≤ yi ≤ M) — coordinates of the points from which the fire started. It is guaranteed that no two points coincide.

Output

Output a line with two space-separated integers x and y — coordinates of the tree that will be the last one to start burning. If there are several such trees, output any.

Examples

Input

3 3
1
2 2


Output

1 1


Input

3 3
1
1 1


Output

3 3


Input

3 3
2
1 1 3 3


Output

2 2

Solution (in JAVA):

Solution:
import java.io.*;
import java.util.*;

public class C
{
	String line;
	StringTokenizer inputParser;
	BufferedReader is;
	FileInputStream fstream;
	DataInputStream in;
	
	void openInput(String file)
	{

		if(file==null)is = new BufferedReader(new InputStreamReader(System.in));//stdin
		else
		{
			try{
		
				
			fstream = new FileInputStream(file);
			in = new DataInputStream(fstream);
			is = new BufferedReader(new InputStreamReader(in));
			}catch(Exception e)
			{
				System.err.println(e);
			}
		}

	}
	
	void readNextLine()
	{
		try {
			line = is.readLine();
			inputParser = new StringTokenizer(line, " ");
			//System.err.println("Input: " + line);
		} catch (IOException e) {
			System.err.println("Unexpected IO ERROR: " + e);
		}	
		
	}
	
	int NextInt()
	{
		String n = inputParser.nextToken();
		int val = Integer.parseInt(n);
		
		//System.out.println("I read this number: " + val);
		return val;
	}
	
	String NextString()
	{
		String n = inputParser.nextToken();
		return n;
	}
	
	void closeInput()
	{
		try {
			is.close();
		} catch (IOException e) {
			System.err.println("Unexpected IO ERROR: " + e);
		}
			
	}
	
	
	public static void main(String [] argv)
	{
		String filePath=null;
		if(argv.length>0)filePath=argv[0];
		C c = new C(filePath);
	}
	
	public C(String inputFile)
	{
		inputFile="input.txt";
        openInput(inputFile);
        PrintWriter writer=null;
		try {
			writer = new PrintWriter("output.txt");
			
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		}
		
		readNextLine();
		int N=NextInt();
		int M=NextInt();
		readNextLine();
		int K=NextInt();
		readNextLine();
		int [] [] p = new int[N][M];
		int [] [] init = new int [K][2];
		
		for(int i=0; i<K; i++)
		{
			int x=NextInt()-1;
			int y=NextInt()-1;
			p[x][y]=0;
			init[i][0]=x;
			init[i][1]=y;
		}
		
		int max=-1;
		int maxX=-1, maxY=-1;
		
		for(int i=0; i<N; i++)
			for(int j=0; j<M; j++)
			{
				p[i][j]=10000;
				for(int k=0; k<K; k++)
				{
					int n=Math.abs(init[k][0]-i)+Math.abs(init[k][1]-j);
					if(n<p[i][j])p[i][j]=n;
				}
				if(p[i][j]>max)
				{
					max=p[i][j];
					maxX=i+1;
					maxY=j+1;
				}
			}
		
		
	
		writer.println( maxX+" "+maxY);
		
		

		
		closeInput();
		writer.close();
	}

	
}