#include <cassert>
#include <cstdio>
#include <algorithm>
#include <vector>

int main()
{
  using namespace std;
  assert(freopen("manhat.in", "r", stdin) == stdin);
  assert(freopen("manhat.out", "w", stdout) == stdout);

  int t, d, n;
  assert(scanf("%d%d%d", &t, &d, &n) == 3);
  int *x = new int[n], *y = new int[n];
  for (int i = 0; i < n; i++)
    assert(scanf("%d%d", &x[i], &y[i]) == 2);
  int x0 = x[n - 1], y0 = y[n - 1];
  vector <pair <int, int> > ans;
  for (int cx = x0 - d; cx <= x0 + d; cx++)
    for (int cy = y0 - d; cy <= y0 + d; cy++)
    {
      bool good = true;
      for (int i = 0; i < n; i++)
        if (abs(x[i] - cx) + abs(y[i] - cy) > (n - 1 - i) * t + d)
          good = false;
      if (good)
        ans.push_back(make_pair(cx, cy));
    }
  assert(printf("%d\n", ans.size()) >= 0);
  for (int i = 0; i < (int)ans.size(); i++)
    assert(printf("%d %d\n", ans[i].first, ans[i].second) >= 0);

  delete[] x, delete[] y;
  return 0;
}

