#include <iostream>
#include <cstdio>
#include <algorithm>
#include <map>
#include <cmath>

using namespace std;

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n) FOR(i,0,n)
#define LINF (1ll<<60)
#define INF (1<<29)

typedef long long ll;

int h, w, n;
ll x[100000], y[100000];
ll sx[100000], sy[100000];

int main() {
	cin >> h >> w >> n;
	
	REP(i, n) {
		scanf("%d %d", &x[i], &y[i]);
		sx[i] = x[i];
		sy[i] = y[i];
	}
	sort(sx, sx + n);
	sort(sy, sy + n);
	
	ll ans = LINF;
	int ansx = INF, ansy = INF;
	
	REP(i, 2) REP(j, 2) {
		if ((i || j) && n & 1) continue;
		
		int nx = sx[n / 2 - j];
		int ny = sy[n / 2 - i];
		
		ll sum = 0, maxer = -1;
		REP(k, n) {
			ll d = abs(nx - x[k]) + abs(ny - y[k]);
			sum += 2 * d;
			maxer = max(maxer, d);
		}
		sum -= maxer;
		
		if (ans > sum || (ans == sum && ansx > nx) || (ans == sum && ansx == nx && ansy > ny)) {
			ansx = nx;
			ansy = ny;
			ans = sum;
		}
	}
	cout << ans << endl;
	printf("%d %d\n", ansx, ansy);
	return 0;
}