#include <iostream>
#include <string>
#include <vector>
#include <cstring>
#include <climits>
#include <algorithm>
#include <map>
#include <fstream>
using namespace std;
#define mp make_pair

vector<int> median(vector<int> v) {
	sort(v.begin(), v.end());
	int n = v.size();
	vector<int> ret(1, v[n/2]);
	if (n % 2 == 0) {
		ret.push_back(v[n/2-1]);
	}
	return ret;
}

int main() {
	int W, H, N;
	cin >> W >> H >> N;
	vector<int> xs(N), ys(N);
	for (int i=0; i<N; ++i) {
		cin >> xs[i] >> ys[i];
	}
	vector<int> mx = median(xs);
	vector<int> my = median(ys);
	long long res = LLONG_MAX;
	int x, y;
	for (int i=0; i<(int)mx.size(); ++i) {
		for (int j=0; j<(int)my.size(); ++j) {
			long long time = 0, m = 0;
			for (int k=0; k<N; ++k) {
				long long t = abs(xs[k] - mx[i]) + abs(ys[k] - my[j]);
				time += t;
				m = max(m, t);
			}
			long long res2 = 2 * time - m;
			if (mp(res2, mp(mx[i], my[j])) < mp(res, mp(x, y))) {
				res = res2;
				x = mx[i];
				y = my[j];
			}
		}
	}
	cout << res << endl;
	cout << x << " " << y << endl;
	return 0;
}