### constant

MAX_INT = 10 ** 17

### subroutines

def distxy(x0, y0, x1, y1)
  (x1 - x0).abs + (y1 - y0).abs
end

### main

w, h = gets.strip.split(' ').map{|s| s.to_i}
n = gets.strip.to_i

houses = []
hxs = []
hys = []

n.times do
  xi, yi = gets.strip.split(' ').map{|s| s.to_i}
  houses << [xi, yi]
  hxs << xi
  hys << yi
end
#p houses

hxs.sort!
hys.sort!

sx0 = hxs[(n - 1) / 2]
sy0 = hys[(n - 1) / 2]
sx1 = hxs[(n + 1) / 2]
sy1 = hys[(n + 1) / 2]

min_sumd = MAX_INT
min_sx = min_sy = -1

for sxy in [[sx0, sy0], [sx0, sy1], [sx1, sy0], [sx1, sy1]]
  sx, sy = sxy

  sumd = 0
  max_dist = 0

  for hxy in houses
    hx, hy = hxy

    dist = distxy(hx, hy, sx, sy)
    sumd += dist
    max_dist = dist if max_dist < dist
  end

  sumd = sumd * 2 - max_dist

  if min_sumd > sumd
    min_sumd = sumd
    min_sx = sx
    min_sy = sy
  end
end

puts min_sumd
puts [min_sx, min_sy].join(' ')