#include<bits/stdc++.h>
#define int long long
#define MOD 1000000007
#define INF 0x3f3f3f3f
#define INFL 0x3f3f3f3f3f3f3f3f
#define EPS (1e-10)
#define rep(i,n)for(int i=0;i<n;i++)
using namespace std;
typedef long long ll;
typedef pair<int, int>P;

int x[100000], y[100000], tx[100000], ty[100000];
int sum1[100001], sum2[100001];
#define dist(x,y)(abs(i-x)+abs(j-y))
signed main() {
	int w, h, n; scanf("%lld%lld%lld", &w, &h, &n);
	rep(i, n) {
		scanf("%lld%lld", &x[i], &y[i]);
		tx[i] = x[i]; ty[i] = y[i];
	}
	sort(x, x + n); sort(y, y + n);
	rep(i, n) {
		sum1[i + 1] = sum1[i] + x[i];
		sum2[i + 1] = sum2[i] + y[i];
	}
	set<int>ax, ay;
	int mx = LLONG_MAX, my = LLONG_MAX;
	rep(i, n) {
		int a = ((x[i] * i - sum1[i]) + (sum1[n] - sum1[i] - x[i] * (n - i))) * 2;
		if (mx > a) {
			mx = a; ax.clear();
		}
		if (mx == a)ax.insert(x[i]);
		a = ((y[i] * i - sum2[i]) + (sum2[n] - sum2[i] - y[i] * (n - i))) * 2;
		if (my > a) {
			my = a; ay.clear();
		}
		if (my == a)ay.insert(y[i]);
	}
	int ansx, ansy, ans = LLONG_MAX;
	for (int i : ax)for (int j : ay)rep(k, n) {
		int d = mx + my - dist(tx[k], ty[k]);
		if (ans > d) {
			ans = d;
			ansx = i; ansy = j;
		}
	}
	printf("%lld\n%lld %lld\n", ans, ansx, ansy);
}