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

//repetition
#define FOR(i,a,b) for(ll i=(a);i<(b);++i)
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)

//container util
#define all(x) (x).begin(),(x).end()

//typedef
typedef long long ll;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<ll> VLL;
typedef vector<VLL> VVLL;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef pair<ll, ll> PLL;

//const value
//const ll MOD = 1e9 + 7;
//const int dx[] = {0,1,0,-1};//{0,0,1,1,1,-1,-1,-1};
//const int dy[] = {1,0,-1,0};//{1,-1,0,1,-1,0,1,-1};

//conversion
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
inline ll toLL(string s) {ll v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}


int main(){
  ios::sync_with_stdio(false);
  cin.tie(0);
  ll H,W,n;
  cin >> H >> W >> n;
  VLL x(n),y(n);
  rep(i,n) cin >> x[i] >> y[i];
  // x,y座標においてマンハッタン距離が最小になるように独立に考える
  VLL xx(x), yy(y);
  sort(all(xx));
  sort(all(yy));
  VLL midX = { xx[(n-1)/2] , xx[n/2]};
  VLL midY = { yy[(n-1)/2] , yy[n/2]};
  ll ans = LONG_MAX;
  ll ansx, ansy;
  for(ll mx :midX) for(ll my: midY){
    ll tmp = 0, maxDist = 0;
    rep(i,n){
      maxDist = max(maxDist, abs(mx - x[i]) + abs(my - y[i]) );
      tmp += 2LL * (abs(mx - x[i]) + abs(my - y[i]));
    }

    if( (tmp - maxDist) < ans){
      ans = tmp - maxDist;
      ansx = mx, ansy = my;
    }
  }

  cout << ans << endl;
  cout << ansx << " " << ansy << endl;
  return 0;
}

