#include <bits/stdc++.h>
#define FOR(i,n) for(int i=0;i<(int)(n);i++)
#define FORR(i,m,n) for(int i=(int)(m);i<(int)(n);i++)
#define pb(a) push_back(a)
#define mp(x,y) make_pair(x,y)
#define ALL(a) a.begin(),a.end()
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,-1,sizeof(a))
#define len(a) sizeof(a)
#define ll long long
#define pii pair<int,int>
#define INF 1<<29
#define MAX 101010
using namespace std;

int h,w,n;
ll x[MAX],y[MAX],cx[MAX],cy[MAX];

ll calc(ll X,ll Y){
 ll ma=0LL;
 ll tot=0LL;
 FOR(i,n){
  ll d=labs(X-x[i])+labs(Y-y[i]);
  ma=max(ma,d);
  tot+=d;
 }
 return 2*tot-ma;
}

void solve(){
 cin>>h>>w;
 cin>>n;
 FOR(i,n) cin>>x[i]>>y[i];
 FOR(i,n) cx[i]=x[i];
 FOR(i,n) cy[i]=y[i];
 sort(cx,cx+n);
 sort(cy,cy+n);
 ll mx[2],my[2];
 mx[0]=cx[(n-1)>>1];
 mx[1]=cx[n>>1];
 my[0]=cy[(n-1)>>1];
 my[1]=cy[n>>1];
 ll mi=LONG_MAX/4,miX,miY;
 FOR(i,2){
  FOR(j,2){
   ll ret=calc(mx[i],my[j]);
   if(ret<mi){
    mi=ret;
    miX=mx[i];
    miY=my[j];
   }
  }
 }
 cout<<mi<<endl;
 cout<<miX<<" "<<miY<<endl;
}

int main(){
 solve();
 return 0;
}