#include<iostream>

int A[9] = {1,2,4,7,12,20,29,38,52}; long long B[11][11] , N;

int main(){
	std::cin >> N; long long MX = 1;
	for(int i = 2 ; i <= N ; ++i){
		for(int j = 1 ; j < i ; ++j) B[i][j] = B[j][i] = MX * A[j - 1];
		MX += B[i][i - 1] + B[i][i - 2] - B[i - 1][i - 2];
	}
	for(int i = 1 ; i <= N ; ++i) for(int j = 1 ; j <= N ; ++j) std::cout << B[i][j] << " \n"[j == N];
	return 0;
}