// Задача ""
// ??-ая Интернет-олимпиада сезона 2007-2008, базовый уровень
// Автор задачи: Федор Царев, tsarev@rain.ifmo.ru
// Автор решения: Сергей Поромов, poromov@rain.ifmo.ru

import java.io.*;
import java.util.*;

public class mantan_sp implements Runnable {

	public static void main(String[] args) {
		new Thread(new mantan_sp()).run();
	}

	public void run() {
		try {
			Locale.setDefault(Locale.US);
			br = new BufferedReader(new FileReader(FILENAME + ".in"));
			out = new PrintWriter(FILENAME + ".out");
			solve();
			out.close();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	BufferedReader br;

	PrintWriter out;

	StringTokenizer st;

	String nextToken() throws IOException {
		while (st == null || !st.hasMoreTokens()) {
			st = new StringTokenizer(br.readLine());
		}
		return st.nextToken();
	}

	int nextInt() throws IOException {
		return Integer.parseInt(nextToken());
	}

	void myAssert(boolean e, String s) {
		if (!e) {
			throw new Error("Assertion failure " + s);
		}
	}
	
	void inBounds(int l, int r, int x, String name) {
		myAssert(l <= x && x <= r, "Wrong value of " + name);
	}

	private static final String FILENAME = "mantan";

	public void solve() throws IOException {
		int t = nextInt();
		inBounds(1, 100, t, "t");
		int d = nextInt();
		inBounds(1, 100, d, "d");
		int n = nextInt();
		inBounds(1, 100, n, "n");
		int minx = 0;
		int miny = 0;
		int maxx = 0;
		int maxy = 0;
		for (int i = 0; i < n; i++) {
			minx -= t;
			miny -= t;
			maxx += t;
			maxy += t;
			int x = nextInt();
			int y = nextInt();
			int xx = x - y;
			int yy = x + y;
			minx = Math.max(minx, xx - d);
			maxx = Math.min(maxx, xx + d);
			miny = Math.max(miny, yy - d);
			maxy = Math.min(maxy, yy + d);
			myAssert(minx <= maxx, "Wrong navigator at step " + (i + 1));
			myAssert(miny <= maxy, "Wrong navigator at step " + (i + 1));
		}
		ArrayList<Integer> ansx = new ArrayList<Integer>();
		ArrayList<Integer> ansy = new ArrayList<Integer>();
		for (int x = minx; x <= maxx; x++) {
			for (int y = miny; y <= maxy; y++) {
				if ((x + y) % 2 == 0) {
					int xx = (x + y) / 2;
					int yy = (y - x) / 2;
					ansx.add(xx);
					ansy.add(yy);
				}
			}
		}
		out.println(ansx.size());
		for (int i = 0; i < ansx.size(); i++) {
			out.println(ansx.get(i) + " " +  ansy.get(i));
		}
	}
}
