#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <string>
#include <cmath>
#include <cstdio>
#include <iomanip>
#include <fstream>
#include <cassert>
#include <cstring>
#include <unordered_set>
#include <unordered_map>
#include <numeric>
#include <ctime>
#include <bitset>
#include <complex>
#include <chrono>
#include <random>
#include <functional>

using namespace std;

const int INF = 1e9 + 239;

int K;
int ex, ey;
int mx, my;
int ans = INF;
int bx, by;
vector<pair<int, int>> fp;

void relax(vector<pair<int, int>> cand) {
	int cx = 0;
	int cy = 0;
	for (auto t : cand) {
		cx += t.first;
		cy += t.second;
		assert(abs(t.first) == K || abs(t.second) == K);
		assert(abs(t.first) <= K && abs(t.second) <= K);
		
		assert((t.first + t.second) % 2 == 0);
	}
	int dx = abs(ex - cx);
	int dy = abs(ey - cy);
	if (dx % K || dy % K) return;
	// cerr << "hr" << endl;
	assert(dx % K == 0);
	assert(dy % K == 0);
	int cur = max((dx / K), (dy / K)) + (int)cand.size();
	if (cur < ans)  {
		ans = cur;
		bx = cx;
		by = cy;
		fp = cand;
	}
}

void getmod() {
	cerr << mx << ' ' << my << endl;
	if (mx == 0 && my == 0) {
		relax(vector<pair<int, int>> ());
		return;
	}
	if (mx == 0) {
		if (K % 2 == my % 2) {
			pair<int, int> v = {K, my};
			relax(vector<pair<int, int>> (1, v));
		} else {
			pair<int, int> f = {K, 1};
			pair<int, int> s = {K, my - 1};
			vector<pair<int, int>> v = {f, s};
			relax(v);
			f = {K, 1};
			s = {-K, my - 1};
			v = {f, s};
			relax(v);
		}
		return;
	}	
	if (my == 0) {
		if (K % 2 == mx % 2) {
			pair<int, int> v = {mx, K};
			relax(vector<pair<int, int>> (1, v));
		} else {
			pair<int, int> f = {1, K};
			pair<int, int> s = {mx - 1, K};
			vector<pair<int, int>> v = {f, s};
			relax(v);
			f = {1, K};
			s = {mx - 1, -K};
			v = {f, s};
			relax(v);
		}
		return;
	}
	if (K % 2 == 0) {
		if (mx % 2 == 1) {
			return;
		}
		//K (+-)Y
		//(+-)X K
		// cerr << mx << ' ' << my << endl;
		vector<int> fv = {my - K, my};
		vector<int> sv = {mx - K, mx};
		for (int i = 0; i < 2; i++) {
			for (int j = 0; j < 2; j++) {
				pair<int, int> f = {K, fv[i]};
				pair<int, int> s = {sv[j], K};
				vector<pair<int, int>> cand = {f, s};
				relax(cand);
			}
		}
		return;
	} else {
		// cerr << mx << ' ' << my << endl;
		if (my % 2 == 1 && mx % 2 == 1) {
			//(+-)K (+1)
			//(+-)K (Y - 1)
			//X (+-)K
			// int c = K - my;
			for (int i = 0; i < 2; i++) {
				for (int j = 0; j < 2; j++) {
					for (int k = 0; k < 2; k++) {
						for (int l = 0; l < 2; l++) {
							for (int m = 0; m < 2; m++) {
								for (int o = 0; o < 2; o++) {
									pair<int, int> f = {K, my};
									pair<int, int> s = {mx, K};
									// pair<int, int> t = {mx, K};
									if (i) f.first *= -1;
									if (j) f.second *= -1;
									if (k) s.first *= -1;
									if (l) s.second *= -1;
									// if (m) t.first *= -1;
									// if (o) t.second *= -1;
									vector<pair<int, int>> cand = {f, s};
									relax(cand);
								}
							}
						}
					}
				}
			}
		}
		if (mx % 2 == 0 && my % 2 == 1) {
			//(+-)K (+1)
			//(+-)K (Y - 1)
			//X (+-)K
			int c = K - mx;
			for (int i = 0; i < 2; i++) {
				for (int j = 0; j < 2; j++) {
					for (int k = 0; k < 2; k++) {
						for (int l = 0; l < 2; l++) {
							for (int m = 0; m < 2; m++) {
								for (int o = 0; o < 2; o++) {
									pair<int, int> f = {K, my};
									pair<int, int> s = {c, K};
									// pair<int, int> t = {mx, K};
									if (i) f.first *= -1;
									if (j) f.second *= -1;
									if (k) s.first *= -1;
									if (l) s.second *= -1;
									vector<pair<int, int>> cand = {f, s};
									relax(cand);
								}
							}
						}
					}
				}
			}
			for (int i = 0; i < 2; i++) {
				for (int j = 0; j < 2; j++) {
					for (int k = 0; k < 2; k++) {
						for (int l = 0; l < 2; l++) {
							for (int m = 0; m < 2; m++) {
								for (int o = 0; o < 2; o++) {
									pair<int, int> f = {1, K};
									pair<int, int> s = {mx - 1, K};
									pair<int, int> t = {K, my};
									if (i) f.first *= -1;
									if (j) f.second *= -1;
									if (k) s.first *= -1;
									if (l) s.second *= -1;
									if (m) t.first *= -1;
									if (o) t.second *= -1;
									vector<pair<int, int>> cand = {f, s, t};
									relax(cand);
								}
							}
						}
					}
				}
			}
		}
		if (mx % 2 == 1 && my % 2 == 0) {
			//(+-)K (+1)
			//(+-)K (Y - 1)
			//X (+-)K
			int c = K - my;
			for (int i = 0; i < 2; i++) {
				for (int j = 0; j < 2; j++) {
					for (int k = 0; k < 2; k++) {
						for (int l = 0; l < 2; l++) {
							for (int m = 0; m < 2; m++) {
								for (int o = 0; o < 2; o++) {
									pair<int, int> f = {K, c};
									pair<int, int> s = {mx, K};
									// pair<int, int> t = {mx, K};
									if (i) f.first *= -1;
									if (j) f.second *= -1;
									if (k) s.first *= -1;
									if (l) s.second *= -1;
									vector<pair<int, int>> cand = {f, s};
									relax(cand);
								}
							}
						}
					}
				}
			}
			for (int i = 0; i < 2; i++) {
				for (int j = 0; j < 2; j++) {
					for (int k = 0; k < 2; k++) {
						for (int l = 0; l < 2; l++) {
							for (int m = 0; m < 2; m++) {
								for (int o = 0; o < 2; o++) {
									pair<int, int> f = {K, 1};
									pair<int, int> s = {K, my - 1};
									pair<int, int> t = {mx, K};
									if (i) f.first *= -1;
									if (j) f.second *= -1;
									if (k) s.first *= -1;
									if (l) s.second *= -1;
									if (m) t.first *= -1;
									if (o) t.second *= -1;
									vector<pair<int, int>> cand = {f, s, t};
									relax(cand);
								}
							}
						}
					}
				}
			}
		}
		if (mx % 2 == 0 && my % 2 == 0) {
			//(+-)K (+1)
			//(+-)K (Y - 1)
			//X (+-)K
			// cerr << "hr" << endl;
			for (int i = 0; i < 2; i++) {
				for (int j = 0; j < 2; j++) {
					for (int k = 0; k < 2; k++) {
						for (int l = 0; l < 2; l++) {
							for (int m = 0; m < 2; m++) {
								for (int o = 0; o < 2; o++) {
									for (int p = 0; p < 2; p++) {
										for (int r = 0; r < 2; r++) {
											pair<int, int> f = {K, K - my};
											pair<int, int> s = {K - mx, K};
											// pair<int, int> t = {1, K};
											// pair<int, int> d = {mx - 1, K};
											if (i) f.first *= -1;
											if (j) f.second *= -1;
											if (k) s.first *= -1;
											if (l) s.second *= -1;
											// if (m) t.first *= -1;
											// if (o) t.second *= -1;
											// if (p) d.first *= -1;
											// if (r) d.second *= -1;
											// assert(f.second % 2 == 0);
											vector<pair<int, int>> cand = {f, s};
											relax(cand);
										}
									}
								}
							}
						}
					}
				}
			}
		}
	}
}

pair<int, int> solve(int cx, int cy) {
	// cerr << "solve " << cx << ' ' << cy << endl;
	int kek = (cx + cy) / 2;
	pair<int, int> cur = {kek, cx - kek};
	assert(cx == cur.first + cur.second);
	assert(cy == cur.first - cur.second);
	return cur;			
}

signed main() {
	ios_base::sync_with_stdio(false);
	cin.tie(0);

	int x, y;
	cin >> K >> x >> y;
	ex = x + y;
	ey = x - y;
	int rx = 0;
	int ry = 0;
	// cerr << ex << ' ' << ey << endl;
	
	if (ex < 0) rx = 1;
	if (ey < 0) ry = 1;
	ex = abs(ex);
	ey = abs(ey);
	// cerr << rx << ' ' << ry << endl;
	// cerr << ex << ' ' << ey << endl;
	mx = ((ex) % K + K) % K;
	my = ((ey) % K + K) % K;
	getmod();
	if (ans == INF) {
		cout << -1 << endl;
	} else {
		cout << ans << endl;
		// cout << ex << ' ' << ey << endl;
		if (rx) ex *= -1, bx *= -1;
		if (ry) ey *= -1, by *= -1;
		vector<pair<int, int>> cd = fp;
		for (auto &t : cd) {
			if (rx) t.first *= -1;
			if (ry) t.second *= -1;
		}
		// for (auto t : cd) {
		// 	cerr << t.first << ' ' << t.second << endl;
		// }
		// cerr << cd.size() << endl;
		while (bx != ex || by != ey) {
			int dx = 0;
			int dy = 0;
			if (bx < ex) dx = K;
			if (bx > ex) dx = -K;
			if (by < ey) dy = K;
			if (by > ey) dy = -K;
			cd.push_back({dx, dy});
			bx += dx;
			by += dy;
			// cerr << dx << ' ' << dy << endl;
		} 
		{
			int cx = 0;
			int cy = 0;
			for (auto &t : cd) {
				if ((t.first + t.second) % 2) {
					// cerr << t.first << ' ' << t.second << endl;
					if (abs(t.first) == K) {
						if (cy) t.second++;
						else t.second--;
						cy ^= 1;
					} else {
						if (cx) t.first++;
						else t.first--;
						cx ^= 1;
					}
				}
				assert(max(abs(t.first), abs(t.second)) == K);
			}
		}
		int cx = 0;
		int cy = 0;
		pair<int, int> prv;
		for (auto t : cd) {
			cx += t.first;
			cy += t.second;
			auto vl = solve(cx, cy);
			cout << vl.first << ' ' << vl.second << '\n';
			prv = vl;
			// cerr << "V: " << (abs(cur.first - prv.first) + abs(cur.second - prv.second)) << endl;;
			// cout << cur.first << ' ' << cur.second << '\n';
			// cerr << cx << ' ' << cy << endl;
			// cerr << endl;
		}
	}
	// solve()
}


Measured memory_bytes: 4208