#include "bits/stdc++.h"
#define all(x) x.begin(),x.end()
#define rep(i,N) for(int i=0;i<(int)N;++i)
using namespace std;
using ll = long long;
using vint = vector<int>;
using vll = vector<ll>;
using vll2 = vector<vector<ll>>;
const ll INF = (1LL << 30);
const ll LINF = (1LL << 60);
const ll MOD = 1e9 + 7;

int main() {
   cin.tie(0);
   ios::sync_with_stdio(false);
   using P = pair<ll, ll>;

   ll W, H; cin >> W >> H;
   int N; cin >> N;
   vector<P> C(N);
   vll X(N), Y(N);
   rep(i, N) {
      cin >> X[i] >> Y[i];
      C[i] = P(X[i], Y[i]);
   }
   sort(all(X));
   sort(all(Y));

   auto f = [&](ll x, ll y) {
      ll res = 0, maxv = 0;
      rep(i, N) {
         ll sum = abs(x - C[i].first) + abs(y - C[i].second);
         maxv = max(maxv, sum);
         res += 2 * sum;
      }
      return res - maxv;
   };

   vll cx, cy;
   if (N % 2 == 0) {
      cx.emplace_back(X[N / 2 - 1]);
      cx.emplace_back(X[N / 2]);
      cy.emplace_back(Y[N / 2 - 1]);
      cy.emplace_back(Y[N / 2]);
   } else {
      cx.emplace_back(X[N / 2]);
      cy.emplace_back(Y[N / 2]);
   }

   ll ans = LINF;
   ll x, y;
   rep(i, cx.size()) rep(j, cy.size()) {
      ll res = f(cx[i], cy[j]);
      if (res < ans) {
         ans = res;
         x = cx[i], y = cy[j];
      }
   }

   cout << ans << endl;
   cout << x << " " << y << endl;
}
