#include "iostream"
#include "climits"
#include "list"
#include "queue"
#include "stack"
#include "set"
#include "functional"
#include "algorithm"
#include "string"
#include "map"
#include "unordered_map"
#include "unordered_set"
#include "iomanip"
#include "cmath"
#include "random"
#include "bitset"
#include "cstdio"

using namespace std;

const long long int MOD = 1000000007;
const long double EPS = 1e-8;

long long int N, M, K, H, W, L, R;

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);

	cin >> N >> L >> R;
	vector<vector<int>>dis(N * 2, vector<int>(N * 2, MOD));
	vector<int>y;
	vector<int>x;
	for (int i = 0; i*i <= L; i++) {
		int box = L - i * i;
		int bag = sqrt(box);
		if (bag*bag == box) {
			y.push_back(i);
			x.push_back(bag);
			y.push_back(bag);
			x.push_back(i);
		}
	}
	for (int i = 0; i < N * 2; i++) {
		for (int j = 0; j < N * 2; j++) {
			if (dis[i][j] == MOD) {
				dis[i][j] = 0;
				queue<pair<int, int>>Q;
				Q.push({ i,j });
				while (!Q.empty()) {
					int cy = Q.front().first;
					int cx = Q.front().second;
					Q.pop();
					for (int k = 0; k < y.size(); k++) {
						for (int l = -1; l <= 1; l += 2) {
							for (int m = -1; m <= 1; m += 2) {
								int ny = cy + l * y[k];
								int nx = cx + m * x[k];
								if (ny < 0 || nx < 0 || ny >= N * 2 || nx >= N * 2) continue;
								if (dis[ny][nx] > dis[cy][cx] + 1) {
									dis[ny][nx] = dis[cy][cx] + 1;
									Q.push({ ny,nx });
								}
							}
						}
					}
				}
			}
		}
	}
	int odd = 0;
	int even = 0;
	for (auto i : dis) {
		for (auto j : i) {
			if (j == -1)continue;
			if (j % 2)odd++;
			else even++;
		}
	}
	if (odd > even) {
		for (int i = 0; i < N * 2; i++) {
			for (int j = 0; j < N * 2; j++) {
				if (dis[i][j] % 2)dis[i][j] = MOD;
				else dis[i][j] = -1;
			}
		}
	}
	else {
		for (int i = 0; i < N * 2; i++) {
			for (int j = 0; j < N * 2; j++) {
				if (dis[i][j] % 2)dis[i][j] = -1;
				else dis[i][j] = MOD;
			}
		}
	}
	y.clear();
	x.clear();
	for (int i = 0; i*i <= R; i++) {
		int box = R - i * i;
		int bag = sqrt(box);
		if (bag*bag == box) {
			y.push_back(i);
			x.push_back(bag);
			y.push_back(bag);
			x.push_back(i);
		}
	}
	for (int i = 0; i < N * 2; i++) {
		for (int j = 0; j < N * 2; j++) {
			if (dis[i][j] == MOD) {
				dis[i][j] = 0;
				queue<pair<int, int>>Q;
				Q.push({ i,j });
				while (!Q.empty()) {
					int cy = Q.front().first;
					int cx = Q.front().second;
					Q.pop();
					for (int k = 0; k < y.size(); k++) {
						for (int l = -1; l <= 1; l += 2) {
							for (int m = -1; m <= 1; m += 2) {
								int ny = cy + l * y[k];
								int nx = cx + m * x[k];
								if (ny < 0 || nx < 0 || ny >= N * 2 || nx >= N * 2) continue;
								if (dis[ny][nx] > dis[cy][cx] + 1) {
									dis[ny][nx] = dis[cy][cx] + 1;
									Q.push({ ny,nx });
								}
							}
						}
					}
				}
			}
		}
	}
	odd = 0;
	even = 0;
	for (auto i : dis) {
		for (auto j : i) {
			if (j == -1)continue;
			if (j % 2)odd++;
			else even++;
		}
	}
	if (odd > even) {
		for (int i = 0; i < N * 2; i++) {
			for (int j = 0; j < N * 2; j++) {
				if (dis[i][j] % 2)dis[i][j] = MOD;
				else dis[i][j] = -1;
			}
		}
	}
	else {
		for (int i = 0; i < N * 2; i++) {
			for (int j = 0; j < N * 2; j++) {
				if (dis[i][j] % 2)dis[i][j] = -1;
				else dis[i][j] = MOD;
			}
		}
	}
	int cnt = N * N;
	for (int i = 0; i < N * 2; i++) {
		for (int j = 0; j < N * 2; j++) {
			if (dis[i][j] == MOD) {
				cout << i << " " << j << endl;
				cnt--;
				if (!cnt)return 0;
			}
		}
	}
	cout << cnt << endl;
	return 0;
} 

Measured memory_bytes: 2528