#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <map>
#include <set>
#include <vector>
#include <deque>
#include <queue>

#define pb push_back
#define mp make_pair
#define x first
#define y second
#define FOR(i, a, b) for(int i=a, loop=b; i<=loop; ++i)
#define REV(i, a, b) for(int i=a, loop=b; i>=loop; --i)
#define mize(a, b) a = min(a, b)
#define maxi(a, b) a = max(a, b)
#define shl(k) ((k) << 1)
using namespace std;

const int N = 2000 + 5, mod = 998244353;
int n, k;
int64_t C[N][N], G[N][N], F[N], P[N], d[N], tmp, res[N][2];

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

    cin >> k >> n;

    int r = max(k, n);
    FOR(i, 0, r) C[i][0] = 1;
    FOR(i, 1, r) FOR(j, 1, i) C[i][j] = (C[i-1][j] + C[i-1][j-1]) % mod;

    G[0][1] = 1;
    FOR(i, 1, n) FOR(j, 1, k) G[i][j] = (G[i][j-1] + G[i-1][j]) % mod;
    G[0][0] = 1; G[0][1] = 0;
    FOR(i, 0, n) FOR(j, 1, k) G[i][j] = (G[i][j] + G[i][j-1]) % mod;

    for(int m=1; m+m<=k; ++m) FOR(i, 2, n) F[m] = (F[m] + C[i-1][m+m-1] * G[n-i][k-m-m] % mod) % mod;
    for(int m=1; m+m+1<=k; ++m) FOR(i, 2, n) {
        tmp = G[n-i][k-m-m-1];
        if (n-i-1 >= 0) tmp = tmp + G[n-i-1][k-m-m-1];
        P[m] = (P[m] + C[i-1][m+m-1] * tmp % mod) % mod;
    }

    int64_t ans; int m;
    FOR(i, 0, k) res[i][0] = res[i][1] = -1;
    FOR(t, 2, k+k) {
        m = 0; FOR(i, 1, k) if (1<=t-i && t-i<=k) m += 1;
        if (res[m/=2][t&1] != -1) {
            ans = res[m][t&1];
            goto REP;
        }

        if (t&1) {
            ans = G[n][k];
            REV(i, m, 1) {
                d[i] = F[i];
                FOR(j, i+1, m) d[i] = (d[i] - d[j] * C[m-i][j-i] % mod + mod) % mod;
            }
        } else {
            ans = (G[n][k-1] + G[n-1][k-1]) % mod;
            REV(i, m, 1) {
                d[i] = P[i];
                FOR(j, i+1, m) d[i] = (d[i] - d[j] * C[m-i][j-i] % mod + mod) % mod;
            }
        }

        FOR(i, 1, m) ans = (ans - d[i] * C[m][i] % mod + mod) % mod;
        res[m][t&1] = ans;
        REP: cout << ans << '\n';
    }
}

#include<cstdio>
#include<cmath>
#include<queue>
using namespace std;
#define N 100050
#define M 605
int n,d1,d2,head[N],cnt,col[M][M],col2[M][M],vis[M][M],ct,s1[N][2];
queue<int> tp;
void bfs(int x,int y)
{
	vis[x][y]=1;
	tp.push(x*1000+y);
	while(!tp.empty())
	{
		int s=tp.front()/1000,t=tp.front()%1000;tp.pop();
		for(int i=0;i<=ct;i++)
		for(int j=s-s1[i][0];j<=s+s1[i][0];j+=s1[i][0]*2)
		{
			for(int k=t-s1[i][1];k<=t+s1[i][1];k+=s1[i][1]*2)
			{
				if(j>=1&&j<=n&&k>=1&&k<=n&&!vis[j][k])vis[j][k]=1,col[j][k]=col[s][t]^1,tp.push(j*1000+k);
				if(!s1[i][1])break;
			}
			if(!s1[i][0])break;
		}
	}
}
int main()
{
	scanf("%d%d%d",&n,&d1,&d2);n*=2;
	ct=0;for(int i=0;i<=n;i++)if(d1>=i*i){int tp=sqrt(d1-i*i);if(i*i+tp*tp==d1)s1[++ct][0]=i,s1[ct][1]=tp;}
	for(int i=1;i<=n;i++)for(int j=1;j<=n;j++)if(!vis[i][j])bfs(i,j);
	int tp=0;for(int i=1;i<=n;i++)for(int j=1;j<=n;j++)tp+=col[i][j]?-1:1;
	for(int i=1;i<=n;i++)for(int j=1;j<=n;j++)col2[i][j]=col[i][j]^(tp>=0),vis[i][j]=0,col[i][j]=0;
	ct=0;for(int i=0;i<=n;i++)if(d2>=i*i){int tp=sqrt(d2-i*i);if(i*i+tp*tp==d2)s1[++ct][0]=i,s1[ct][1]=tp;}
	for(int i=1;i<=n;i++)for(int j=1;j<=n;j++)if(!vis[i][j])bfs(i,j);
	tp=0;for(int i=1;i<=n;i++)for(int j=1;j<=n;j++)tp+=col[i][j]?-1:1;
	for(int i=1;i<=n;i++)for(int j=1;j<=n;j++)col[i][j]=col[i][j]^(tp>=0);
	int ct=0;
	for(int i=1;i<=n;i++)for(int j=1;j<=n;j++)if(ct<n*n/4&&col[i][j]==1&&col2[i][j]==1)printf("%d %d\n",i-1,j-1),ct++;
}