#include using namespace std; #define all(x) (x).begin(), (x).end() #define rall(x) (x).rbegin(), (x).rend() #define ms(a,val) memset(a,val,sizeof(a)) #define sz(a) int((a).size()) #define pb push_back #define mp make_pair #define F first #define S second #define chtoi(x) (int)((x)-'a') #define rep(i,a,b) for(int i=(a);i<=(b);++i) #define rrep(i,a,b) for(int i=(a);i>=(b);--i) #define fi freopen("input.txt", "r+", stdin); #define fo freopen("output.txt", "w", stdout); #define endl '\n' #define MAX 1000000004 #define MOD 10000000007 typedef long long ll; typedef vector vi; typedef vector vll; typedef vector vvll; typedef vector > vvi; typedef pair ii; typedef pair pii; typedef vector > vii; typedef vector > > vvii; int gcd(int a,int b){ if(b==0) return a; return gcd(b,a%b); } int n,grid[27][27],ans[27][27]; bool ch(int x,int y){ return (x>=0 && x<=n-1 && y>=0 && y<=n-1); } int solve(int a,int b){ int x,y; queue q; int arrx[8]={a,a,-a,-a,b,b,-b,-b}; int arry[8]={b,-b,-b,b,a,-a,-a,a}; int c=0,ans=-1; q.push(pii(ii(0,0),0)); grid[0][0]=1; while(!q.empty() && q.front().F!=ii(n-1,n-1)){ //c++; //if(c>1000) break; pii t=q.front(); q.pop(); rep(i,0,7){ int nx=t.F.F+arrx[i]; int ny=t.F.S+arry[i]; if(ch(nx,ny) && !grid[nx][ny]){ q.push(pii(ii(nx,ny),t.S+1)); grid[nx][ny]=1; } } } if(!q.empty() && q.front().F==ii(n-1,n-1)) ans=q.front().S; return ans; } int main(){ //fi;fo; //std::cout << std::setprecision(6) << std::fixed; int t; cin>>n; rep(i,1,n-1){ rep(j,1,i){ ms(grid,0); ans[i][j]=solve(i,j); } } rep(i,1,n-1){ rep(j,i+1,n-1){ ans[i][j]=ans[j][i]; } } rep(i,1,n-1){ rep(j,1,n-1){ cout<