#include<bits/stdc++.h>
#define int long long
using namespace std;
signed main(){
    int N;
    cin>>N;
    for(int i=0;i<N;i++){
        for(int j=0;j<N;j++){
            cout<<(i*2%N+N-j)%N+1;
            if(j==N-1)cout<<endl;
            else cout<<' ';
        }
    }
}