#include <bits/stdc++.h>
using namespace std;
#define int long long
#define maxval ((int)(1e11))

int RAND(){
	int a = 1;
	while(a < maxval){
		a *= rand();
	}
	return a % maxval + 1;
}

int cmp(int a){
	if(a <= maxval) return a;
	else return rand();
}

signed main(){
	int N, i, j;
	srand(4)
	scanf("%lld", &N);
	vector<vector<int>> w(N, vector<int>(N, 0));
	vector<int> v(N, 0);
	while(1){
		for(i = 0; i < N; i++){
			v[i] = RAND();
		}
		int k = 0;
		for(i = 0; i < N; i++){
			for(j = i + 1; j < N; j++){
				w[i][j] = cmp(1ll << k);
				k++;
				w[j][i] = w[i][j];
			}
		}
		for(i = 0; i < N; i++){
			for(j = 0; j < N; j++){
				printf("%lld ", w[i][j]);
			}
			printf("\n");
		}
		return 0;
	}
}