#include <cstdio>
#include <vector>
#include <cstdlib>
#include <algorithm>
using namespace std;
#define pb push_back
typedef long long ll;
int main()
{
	ll n,m,k;
	scanf("%lld %lld %lld",&n,&m,&k);
	vector<ll>x,y,x2,y2;
	for(int i=0;i<k;i++){ ll xx,yy;scanf("%lld %lld",&xx,&yy);x.pb(xx);y.pb(yy);x2.pb(xx);y2.pb(yy);};
	sort(x.begin(),x.end()); sort(y.begin(),y.end());
	ll xi,yi; long long ret=1e15;
	for(int i=k-1;i<=k;i++)for(int j=k-1;j<=k;j++)
	{
		ll v=x[i/2]; ll w=y[j/2]; ll res=0,re=0;
		for(int a=0;a<k;a++){re=max(re,(ll)(abs(x2[a]-v)+abs(y2[a]-w))); res+=(ll)(abs(x2[a]-v)+abs(y2[a]-w))*2ll;}
		if(ret>res-re){ ret=min(ret,res-re); xi=v; yi=w;}
	}
	printf("%lld\n%lld %lld\n",ret,xi,yi);
}