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