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

public class mantan_rs implements Runnable {
    private BufferedReader in;
    private PrintWriter out;
    
    private void check(boolean expr, String msg) {
        if (!expr) {
            throw new Error(msg);
        }
    }
    
    private void checkBounds(int n, int low, int hi, String nStr) {
        check((low <= n) && (n <= hi), nStr + " is not in [" + low + ", " + hi + "]");
    }
    
    private void solve() throws IOException {
    	StringTokenizer st = new StringTokenizer(in.readLine());
    	int t = Integer.parseInt(st.nextToken());
    	int d = Integer.parseInt(st.nextToken());
    	int n = Integer.parseInt(st.nextToken());
    	checkBounds(t, 1, 100, "t");
    	checkBounds(d, 1, 100, "d");
    	checkBounds(n, 1, 100, "n");
    	int s1 = 0, s2 = 0, d1 = 0, d2 = 0;
    	for (int i = 0; i < n; i++) {
    		s1 -= t;
    		s2 += t;
    		d1 -= t;
    		d2 += t;
    		st = new StringTokenizer(in.readLine());
    		int x0 = Integer.parseInt(st.nextToken());
    		int y0 = Integer.parseInt(st.nextToken());
    		s1 = Math.max(s1, x0 + y0 - d);
    		s2 = Math.min(s2, x0 + y0 + d);
    		d1 = Math.max(d1, x0 - y0 - d);
    		d2 = Math.min(d2, x0 - y0 + d);
    		check(s1 <= s2 && d1 <= d2, "navigator doesn't work");
    	}
    	int[] ansX = new int[2 * d * 2 * d + 1];
    	int[] ansY = new int[2 * d * 2 * d + 1];
    	int count = 0;
    	for (int x = (s1 + d1) / 2; x <= (s2 + d2) / 2 + 1; x++) {
    		int low = Math.max(s1 - x, x - d2);
    		int hi = Math.min(s2 - x, x - d1);
    		for (int y = low; y <= hi; y++) {
    			ansX[count] = x;
    			ansY[count] = y;
    			count++;
    		}
    	}
    	out.println(count);
    	for (int i = 0; i < count; i++) {
    		out.println(ansX[i] + " " + ansY[i]);
    	}
    }
    
    public static void main(String[] args) {
        new Thread(new mantan_rs()).start();
    }

    public void run() {
        String problem = getClass().getName().split("_")[0];
        try {
            in = new BufferedReader(new FileReader(new File(problem + ".in")));
            out = new PrintWriter(new File(problem + ".out"));
            solve();
            in.close();
            out.close();
        } catch (IOException e) {
            e.printStackTrace();
            System.exit(1);
        }
    }
}
