#include <bits/stdc++.h>
using namespace std;
int main(){
int n,a[10][10];
cin>>n;
for(int i=0;i<n;i++){
for(int j=0;j<n;j++){
if(i+j==n-1){
cout<<setw(3)<<1;
}else{
cout<<setw(3)<<0;
}
}
cout<<endl;
}
}
/**************************************************************
Problem: 1191
User: wangyiyang
Language: C++
Result: Accepted
Time:10 ms
Memory:2072 kb
****************************************************************/