#include <stdio.h>
#include <cmath>
#include <algorithm>
#include <cfloat>
#include <stack>
#include <queue>
#include <vector>
#include <string>
#include <iostream>
#include <set>
#include <map>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define MOD 1000000007
#define EPS 0.000000001
using namespace std;

struct Info{
	Info(ll arg_X,ll arg_Y){
		X = arg_X;
		Y = arg_Y;
	}
	ll X,Y;
};

int main(){

	ll W,H;
	scanf("%lld %lld",&W,&H);

	int N;
	scanf("%d",&N);

	vector<Info> V;
	vector<ll> V_X,V_Y;
	ll tmp_X,tmp_Y;

	for(int i = 0; i < N; i++){
		scanf("%lld %lld",&tmp_X,&tmp_Y);
		V.push_back(Info(tmp_X,tmp_Y));
		V_X.push_back(tmp_X);
		V_Y.push_back(tmp_Y);
	}

	sort(V_X.begin(),V_X.end());
	sort(V_Y.begin(),V_Y.end());

	vector<ll> X_CAN,Y_CAN;

	X_CAN.push_back(V_X[(N-1)/2]);
	X_CAN.push_back(V_X[(N-1)/2+1]);

	Y_CAN.push_back(V_Y[(N-1)/2]);
	Y_CAN.push_back(V_Y[(N-1)/2+1]);

	ll ans = 9999999999999999;
	ll ans_X,ans_Y;

	for(int i = 0; i < X_CAN.size(); i++){
		tmp_X = X_CAN[i];
		for(int k = 0; k < Y_CAN.size(); k++){
			tmp_Y = Y_CAN[k];

			ll tmp_sum = 0;
			ll max_value = 0;

			for(int a = 0; a < N; a++){
				tmp_sum += abs(tmp_X-V[a].X)+abs(tmp_Y-V[a].Y);
				max_value = max(max_value,abs(tmp_X-V[a].X)+abs(tmp_Y-V[a].Y));
			}

			tmp_sum = 2*tmp_sum-max_value;

			if(tmp_sum < ans){
				ans = tmp_sum;
				ans_X = tmp_X;
				ans_Y = tmp_Y;
			}else if(tmp_sum == ans){
				if(ans_X != tmp_X){
					ans_X = min(ans_X,tmp_X);
				}else{
					ans_Y = min(ans_Y,tmp_Y);
				}
			}
		}
	}

	printf("%lld\n",ans);
	printf("%lld %lld\n",ans_X,ans_Y);

	return 0;
}