include[HTML_REMOVED]
using namespace std;
int main()
{ int N=100;
int a[N][N],n;
while(cin>>n,n){
for( int i=0;i<n;i){
for(int j=i,k=1;j<n;j){
a[i][j]=k;
a[j][i]=k;
k;
}
}for(int i=0;i<n;i){
for(int j=0;j<n;j++){
cout<<a[i][j]<<” “;
}
cout<<endl;
}cout<<endl;
}
return 0;
}