#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;
	}
	int dx = abs(ex - cx);
	int dy = abs(ey - cy);
	if (dx % K || dy % K) return;
	int cur = max((dx / K), (dy / K)) + (int)cand.size();
	if (cur < ans)  {
		ans = cur;
		bx = cx;
		by = cy;
		fp = cand;
	}
}

void getmod() {
	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;
		}
		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 {
		if (my % 2 == 1 && mx % 2 == 1) {
			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++) {
							pair<int, int> f = {K, my};
							pair<int, int> s = {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);
						}
					}
				}
			}
		}
		if (mx % 2 == 0 && my % 2 == 1) {
			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++) {
							pair<int, int> f = {K, my};
							pair<int, int> s = {c, 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) {
			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++) {
							pair<int, int> f = {K, c};
							pair<int, int> s = {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) {
			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++) {
							pair<int, int> f = {K, K - my};
							pair<int, int> s = {K - 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);
						}
					}
				}
			}
		}
	}
}

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;	
	if (ex < 0) rx = 1;
	if (ey < 0) ry = 1;
	ex = abs(ex);
	ey = abs(ey);
	mx = ((ex) % K + K) % K;
	my = ((ey) % K + K) % K;
	getmod();
	if (ans == INF) {
		cout << -1 << endl;
	} else {
		cout << ans << 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;
		}
		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;
		} 
		{
			int cx = 0;
			int cy = 0;
			for (auto &t : cd) {
				if ((t.first + t.second) % 2) {
					if (abs(t.first) == K) {
						if (cy) t.second++;
						else t.second--;
						cy ^= 1;
					} else {
						if (cx) t.first++;
						else t.first--;
						cx ^= 1;
					}
				}
			}
		}
		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;
		}
	}
}


Measured memory_bytes: 4208