// Original C++ solution (slower):
#include<iostream>

#include<vector>

#include<algorithm>

#include<cstring>

#include<cmath>

using namespace std;



#define MAX_N 1000000

#define INF 1145141145141919810LL;



long long x[MAX_N],y[MAX_N],lx[MAX_N],ly[MAX_N],d[MAX_N],n,h,w,sx,sy,c,mx,my,sum,minx,dx,dy;

vector<long long>X,Y,BX,BY;



int main(){

	cin>>h>>w>>n;

	for(int i=0;i<n;i++){

		cin>>x[i]>>y[i];

		lx[i]=x[i];ly[i]=y[i];

		sx+=x[i];

		sy+=y[i];

	}

	sort(x,x+n);

	sort(y,y+n);

	mx=INF;my=INF;minx=INF;



	for(int i=0;i<n;i++){

		if(i==0){c=x[0];}

		else{c=x[i]-x[i-1];}

		sx+=(-n+i*2)*c;

		if(mx==sx){X.push_back(x[i]);}

		if(mx>sx){mx=sx;X.clear();X.push_back(x[i]);}

	}



	for(int i=0;i<n;i++){

		if(i==0){c=y[0];}

		else{c=y[i]-y[i-1];}

		sy+=(-n+i*2)*c;

		if(my==sy){Y.push_back(y[i]);}

		if(my>sy){my=sy;Y.clear();Y.push_back(y[i]);}

	}

	for(int i=0;i<X.size();i++){

		if(i<10){BX.push_back(X[i]);}

		else{if(X[i]!=X[i-10]){BX.push_back(X[i]);}}

	}

	for(int i=0;i<Y.size();i++){

		if(i<10){BY.push_back(Y[i]);}

		else{if(Y[i]!=Y[i-10]){BY.push_back(Y[i]);}}

	}

	for(int i=0;i<BX.size();i++){

		for(int j=0;j<BY.size();j++){

			memset(d,0,sizeof(d));

			sum=0;

			for(int k=0;k<n;k++){

				d[k]=abs(BX[i]-lx[k])+abs(BY[j]-ly[k]);

				sum+=d[k]*2;

			}

			sort(d,d+n);

			sum-=d[n-1];

			if(minx>sum){

				minx=sum;

				dx=BX[i];

				dy=BY[j];

			}

		}

	}

	cout<<minx<<endl<<dx<<' '<<dy<<endl;

	return 0;

}

// Optimized solution to the same problem (faster):
#include<iostream>

#include<vector>

#include<algorithm>

using namespace std;

long long x[200000], y[200000], n, H, W;

vector<long long>X, Y; vector<pair<long long, long long>>candidate;

long long dists(long long px, long long py) {

	vector<long long>RR; long long sum = 0;

	for (int i = 0; i < n; i++) {

		long long TT = abs(px - x[i]) + abs(py - y[i]);

		RR.push_back(TT); sum += TT;

	}

	sort(RR.begin(), RR.end());

	return sum * 2 - RR[RR.size() - 1];

}

int main() {

	cin >> H >> W >> n; for (int i = 0; i < n; i++) { cin >> x[i] >> y[i]; X.push_back(x[i]); Y.push_back(y[i]); }

	sort(X.begin(), X.end()); sort(Y.begin(), Y.end());

	vector<long long>HH, WW;

	if (n % 2 == 1) { HH.push_back(X[X.size() / 2]); WW.push_back(Y[Y.size() / 2]); }

	if (n % 2 == 0) {

		HH.push_back(X[X.size() / 2 - 1]); HH.push_back(X[X.size() / 2]);

		WW.push_back(Y[Y.size() / 2 - 1]); WW.push_back(Y[Y.size() / 2]);

	}

	unique(X.begin(), X.end()); unique(Y.begin(), Y.end());

	int pos1 = lower_bound(X.begin(), X.end(), HH[0]) - X.begin();

	int pos2 = lower_bound(Y.begin(), Y.end(), WW[0]) - Y.begin();

	int pos3 = 0, pos4 = 0;

	if (n % 2 == 0) {

		int pos1 = lower_bound(X.begin(), X.end(), HH[1]) - X.begin();

		int pos2 = lower_bound(Y.begin(), Y.end(), WW[1]) - Y.begin();

	}

	if (pos1 >= 1) { HH.push_back(X[pos1 - 1]); }

	if (pos1 < X.size() - 1 && n % 2 == 1) { HH.push_back(X[pos1 + 1]); }

	if (pos3 < X.size() - 1 && n % 2 == 0) { HH.push_back(X[pos3 + 1]); }

	if (pos2 >= 1) { WW.push_back(Y[pos2 - 1]); }

	if (pos2 < Y.size() - 1 && n % 2 == 1) { WW.push_back(Y[pos2 + 1]); }

	if (pos4 < Y.size() - 1 && n % 2 == 0) { WW.push_back(Y[pos4 + 1]); }

	for (int i = 0; i < HH.size(); i++) { for (int j = 0; j < WW.size(); j++)candidate.push_back(make_pair(HH[i], WW[j])); }

	long long minx = 999999999999999999LL, mx = 0, my = 0; sort(candidate.begin(), candidate.end());

	for (int i = 0; i < candidate.size(); i++) {

		long long UU = dists(candidate[i].first, candidate[i].second);

		if (minx > UU) { minx = UU; mx = candidate[i].first; my = candidate[i].second; }

	}

	cout << minx << endl << mx << ' ' << my << endl;

	return 0;

}

// Fastest known solution for this problem: