class in{struct myIterator{int it;const bool rev;explicit constexpr myIterator(int it_, bool rev=false):it(it_),rev(rev){}int operator*(){return it;}bool operator!=(myIterator& r){return it!=r.it;}void operator++(){rev?--it:++it;}};const myIterator i,n;public:explicit constexpr in(int n):i(0),n(n){}explicit constexpr in(int i,int n):i(i,n<i),n(n){}const myIterator& begin(){return i;}const myIterator& end(){return n;}};

#include <bits/stdc++.h>
using namespace std;

using i64 = long long;
void calc(i64 mean, const vector<i64>& vec, vector<i64>& ma) {
    for(int i : in(vec.size())) {
        i64 t = vec[i];
        i64 plus = mean > t ? mean - t : t - mean;
        ma[i] += plus;
    }
}
int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    i64 w, h, n;
    cin >> w >> h >> n;
    vector<i64> xcoord(n), ycoord(n);
    for(int i : in(n))
      cin >> xcoord[i] >> ycoord[i];
    auto sortx = xcoord, sorty = ycoord;
    sort(sortx.begin(), sortx.end());
    sort(sorty.begin(), sorty.end());
    vector<i64> midId = {n / 2};
    if(~n & 1) midId.emplace_back(n / 2 - 1);
    i64 sum = 0LL;
    for(int i : in(n)) {
        if(i <= midId[0])
          sum += sortx[midId[0]] - sortx[i] + sorty[midId[0]] - sorty[i];
        else
          sum += sortx[i] - sortx[midId[0]] + sorty[i] - sorty[midId[0]];
    }
    tuple<i64, i64, i64> ans(0LL, -1e18, -1e18);
    vector<i64> ma(n, 0LL);
    for(auto id1 : midId) for(auto id2 : midId) {
        i64 x = sortx[id1], y = sorty[id2];
        fill(ma.begin(), ma.end(), 0LL);
        calc(x, xcoord, ma); calc(y, ycoord, ma);
        ans = max(ans, make_tuple(*max_element(ma.begin(), ma.end()), -x, -y));
    }
    i64 minus, x, y; tie(minus, x, y) = ans;
    cout << sum * 2LL - minus << '\n' << -x << ' ' << -y << endl;
    return 0;
}