#include <iostream>
#include <fstream>
#include <stdio.h>
#include <math.h>
#include <time.h>
#include <string>
#include <tuple>
#include <vector>
#include <map>
#include <unordered_map>
#include <list>
#include <set>
#include <stack>
#include <queue>
#include <cstdlib>
#include <algorithm>
#include <random>
#include <cassert>
using namespace std;
#define LL long long
#define MP(a, b) make_pair(a, b)
#define MMP(a, b, c) make_pair(make_pair(a, b), c)
#define MAX 1000000000
#undef INT_MIN
#undef INT_MAX
#define INT_MIN -2147483647
#define INT_MAX 2147483647
#define LL_MIN (LL)-9223372036854775807
#define LL_MAX (LL)9223372036854775807
#define PI 3.14159265359

int main(){
    ios::sync_with_stdio(false);

    int W,H,N;
    cin >> W >> H >> N;
    vector<LL> X, Y;
    vector<pair<LL,LL> > XY;
    for(int i=0; i<N; i++){
        LL x,y;
        cin >> x >> y;
        X.push_back(x);
        Y.push_back(y);
        XY.push_back(MP(x, y));
    }
    sort(X.begin(), X.end());
    sort(Y.begin(), Y.end());

    if(N%2 == 1){
        LL ansX = X[X.size()/2];
        LL ansY = Y[Y.size()/2];
        LL ans = 0;
        LL m = 0;
        for(int i=0; i<N; i++){
            ans += abs(ansX - XY[i].first) + abs(ansY - XY[i].second);
            m = max(m, abs(ansX - XY[i].first) + abs(ansY - XY[i].second));
        }
        ans = ans * 2 - m;
        cout << ans << endl << ansX << " " << ansY << endl;
    }
    else{
        LL ansX = X[X.size()/2];
        LL ansY = Y[Y.size()/2];
        LL ans = LL_MAX;
        pair<LL,LL> A;
        LL tmp, m;

        ansX = X[X.size()/2-1];
        ansY = Y[Y.size()/2-1];
        tmp = 0;
        m = 0;
        for(int i=0; i<N; i++){
            tmp += abs(ansX - XY[i].first) + abs(ansY - XY[i].second);
            m = max(m, abs(ansX - XY[i].first) + abs(ansY - XY[i].second));
        }
        tmp = tmp * 2 - m;
        if(ans > tmp){
            ans = tmp;
            A = MP(ansX, ansY);
        }

        ansX = X[X.size()/2-1];
        ansY = Y[Y.size()/2];
        tmp = 0;
        m = 0;
        for(int i=0; i<N; i++){
            tmp += abs(ansX - XY[i].first) + abs(ansY - XY[i].second);
            m = max(m, abs(ansX - XY[i].first) + abs(ansY - XY[i].second));
        }
        tmp = tmp * 2 - m;
        if(ans > tmp){
            ans = tmp;
            A = MP(ansX, ansY);
        }

        ansX = X[X.size()/2];
        ansY = Y[Y.size()/2-1];
        tmp = 0;
        m = 0;
        for(int i=0; i<N; i++){
            tmp += abs(ansX - XY[i].first) + abs(ansY - XY[i].second);
            m = max(m, abs(ansX - XY[i].first) + abs(ansY - XY[i].second));
        }
        tmp = tmp * 2 - m;
        if(ans > tmp){
            ans = tmp;
            A = MP(ansX, ansY);
        }

        ansX = X[X.size()/2];
        ansY = Y[Y.size()/2];
        tmp = 0;
        m = 0;
        for(int i=0; i<N; i++){
            tmp += abs(ansX - XY[i].first) + abs(ansY - XY[i].second);
            m = max(m, abs(ansX - XY[i].first) + abs(ansY - XY[i].second));
        }
        tmp = tmp * 2 - m;
        if(ans > tmp){
            ans = tmp;
            A = MP(ansX, ansY);
        }

        cout << ans << endl << A.first << " " << A.second << endl;
    }

    return 0;
}


Measured memory_bytes: 6404