#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<vector>
#include<map>
#include<set>
#include<string>
#include<queue>
#include<stack>
using namespace std;
#define MOD 1000000007
#define INF (1<<29)
#define LINF (1LL<<60)
#define EPS (1e-10)
typedef long long Int;
typedef pair<Int, Int> P;

vector<P> ans[4], ban[2];
Int d[2];
Int n ;
bool come[2][648][648];
Int color[648][648];
void dfs(int x, int y, int k, int c = 0){
  if(x < 0 || x >= 2*n || y < 0 || y >= 2*n)return;
  if(come[k][x][y])return;
  come[k][x][y] = true;
  color[x][y] +=  c << k;
  for(auto b:ban[k]){
    int nx = x + b.first, ny = y + b.second;
    dfs(nx, ny, k, !c);
  }
}

int main(){
  cin >> n >> d[0] >> d[1];
  for(int i = 0;i < 2*n;i++){
    for(int j = 0;j < 2*n;j++){
      for(int k = 0;k < 2;k++){
	if(i * i + j * j == d[k]){
	  ban[k].push_back(P(i,j));
	  ban[k].push_back(P(i,-j));
	  ban[k].push_back(P(-i,j));
	  ban[k].push_back(P(-i,-j));
	}
      }
    }
  }
  
  for(int i = 0;i < 2*n;i++){
    for(int j = 0;j < 2*n;j++){
      dfs(i, j, 0);
      dfs(i, j, 1);
    }
  }

  for(int i = 0;i < 2*n;i++){
    for(int j = 0;j < 2*n;j++){
      ans[color[i][j]].push_back(P(i,j));
    }
  }
  for(int i = 0;i < 4;i++){
    if(ans[i].size() < n*n)continue;
    for(int j = 0;j < n*n;j++){
      P point = ans[i][j];
      cout << point.first << " " << point.second << endl;
    }
    return 0;
  }
  return 0;
}