/* Your prologue will be the story. */
/* Copyright by HenryLi */
#include<iostream>
#include<algorithm>
#include<queue>
#include<string>
#include<map>
#include<vector>
#include<set>
#include<sstream>
#include<stack>
#include<ctime>
#include<cmath>
#include<cctype>
#include<climits>
#include<cstring>
#include<cstdio>
#include<cstdlib>
#include<iomanip>
#include<bitset>
#include<complex>
using namespace std;
template <class _T> inline void read(_T &_x) {
	int _t; bool _flag=false;
	while((_t=getchar())!='-'&&(_t<'0'||_t>'9')) ;
	if(_t=='-') _flag=true,_t=getchar(); _x=_t-'0';
	while((_t=getchar())>='0'&&_t<='9') _x=_x*10+_t-'0';
	if(_flag) _x=-_x;
}
typedef long long LL;
int n, d1, d2, c1, c2;
bool check(int a, int b, int c) {
	if (c & 1) return (a >> (c / 2)) % 2 == 0;
	return (a >> (c / 2)) % 2 == (b >> (c / 2)) % 2;
}
int main() {
	//freopen("D.in","r",stdin);
	//freopen("D.out","w",stdout);
	read(n), read(d1), read(d2);
	while (d1 % (1 << (c1 + 1)) == 0) ++c1;
	while (d2 % (1 << (c2 + 1)) == 0) ++c2;
	int tot = 0;
	for (int i = 0; i < 2 * n && tot < n * n; ++i) {
		for (int j = 0; j < 2 * n && tot < n * n; ++j) {
			if (check(i, j, c1) && check(i, j, c2)) {
				cout << i << ' ' << j << endl;
				++tot;
			}
		}
	}
	return 0;
}

