#include<iostream>
#include<string>
#include<cmath>
#include<queue>
#include<map>
#include<set>
#include<list>
#include<iomanip>
#include<vector>
#include<random>
#include<functional>
#include<algorithm>
#include<cstdio>
#include<unordered_map>
using namespace std;
//---------------------------------------------------
//????????????????????????????????????
typedef long long ll;
typedef long double ld;
#define str string
#define rep(i,j) for(ll i=0;i<(long long)(j);i++)
const ll Mod = 1000000007;
const ll gosenchou = 5000000000000000;
short gh[2][4] = { { 0,0,-1,1 },{ -1,1,0,0 } };
struct P {
	ll pos, cost;
};
bool operator<(P a, P b) { return a.cost < b.cost; }
bool operator>(P a, P b) { return a.cost > b.cost; }
struct B {//??£??\???????????¨???
	ll to, cost;
};
struct E {//???????????±?????\???????????°
	ll from, to, cost;
};
bool operator<(E a, E b) {
	return a.cost < b.cost;
}
struct H {
	ll x, y;
};
bool operator<(H a, H b) {
	if (a.x != b.x) return a.x < b.x;
	return a.y < b.y;
}
bool operator>(H a, H b) {
	if (a.x != b.x) return a.x > b.x;
	return a.y > b.y;
}
bool operator==(H a, H b) {
	return a.x == b.x&&a.y == b.y;
}
bool operator!=(H a, H b) {
	return a.x != b.x || a.y != b.y;
}
ll gcm(ll i, ll j) {//?????§??¬?´???°
	if (i > j) swap(i, j);
	if (i == 0) return j;
	return gcm(j%i, i);
}
ld rad(H a, H b) {
	return sqrt(pow(a.x - b.x, 2.0) + pow(a.y - b.y, 2.0));
}//rad?????§?¨???????2??????????????¢
ll ari(ll a, ll b, ll c) {
	return (a + b)*c / 2;
}//????????°?????????
bool suf(ld a, ld b, ld c, ld d) {
	if (b <= c || d <= a) return 0;
	return 1;
}//[a,b),[c,d)
ll fact(ll i) {
	ll sum = 1;
	for (ll j = 2; j <= i; j++)
		sum = (sum* j) % Mod;
	return sum;
}//??????(??£???
#define int long long
const long long inf = 4523372036854775807;
const int iinf = 1500000000;
//---------------------------------------------------
//+++++++++++++++++++++++++++++++++++++++++++++++++++
int w, h, n;
H a[100000];
int x[2][100000], y[2][100000];
ld sr(ld t,int r) {
	int k = lower_bound(x[0], x[0] + n, t) - x[0];
	ld sum = 0;
	k--;
	if (k >= 0)
		sum += (t*(k + 1) - x[1][k]);
	sum += (x[1][n - 1] - (k < 0 ? 0 : x[1][k]) - t*(n - k - 1));
	return sum * 2 - abs(t - a[r].x);
}
int solve(int r) {
	ld s = 0, e = w+1, t1, t2;
	while (e - s > 0.0001) {
		t1 = (e - s) / 3 + s, t2 = (e - s) * 2 / 3 + s;
		ld s1 = sr(t1, r), s2 = sr(t2, r);
		if (s1 > s2)
			s = t1;
		else if (s1 == s2)
			s = t1, e = t2;
		else e = t2;
	}
	return round(s);
}
ld sr2(ld t, int r) {
	int k = lower_bound(y[0], y[0] + n, t) - y[0];
	ld sum = 0;
	k--;
	if (k >= 0)
		sum += (t*(k + 1) -  y[1][k]);
	sum += (y[1][n - 1] - (k < 0 ? 0 : y[1][k]) - t*(n - k - 1));
	return sum * 2 - abs(t - a[r].y);
}
int solve2(int r) {
	ld s = 0, e = h + 1, t1, t2;
	while (e - s > 0.0001) {
		t1 = (e - s) / 3 + s, t2 = (e - s) * 2 / 3 + s;
		ld s1 = sr2(t1, r), s2 = sr2(t2, r);
		if (s1 > s2)
			s = t1;
		else if (s1 == s2)
			s = t1, e = t2;
		else e = t2;
	}
	return round(s);
}
signed main() {
	cin >> w >> h >> n;
	for (int i = 0; i < n; i++) {
		cin >> a[i].x >> a[i].y;
		x[0][i] = a[i].x;
		y[0][i] = a[i].y;
	}
	sort(x[0], x[0] + n);
	sort(y[0], y[0] + n);
	x[1][0] = x[0][0]; y[1][0] = y[0][0];
	for (int i = 1; i < n; i++) {
		x[1][i] = x[1][i - 1] + x[0][i];
		y[1][i] = y[1][i - 1] + y[0][i];
	}
	int ans[3] = { inf,0,0 };
	for (int i = 0; i < n; i++) {
		int res = 0;
		int t = solve(i);
		res += sr(t, i);
		int t2 = solve2(i);
		res += sr2(t2, i);
		if (res < ans[0] || (res == ans[0] && (t < ans[1] || (t == ans[1] && t2 < ans[2])))) {
			ans[0] = res;
			ans[1] = t;
			ans[2] = t2;
		}
	}
	cout << ans[0] << endl << ans[1] << " " << ans[2] << endl;
	getchar(); getchar();
}

Measured memory_bytes: 7972