#include<bits/stdc++.h>
using namespace std;
using LL = long long;
using ULL = unsigned long long;
#define rep(i,n) for(int i=0; i<(n); i++)

int main() {
    int N; cin >> N;
    rep(y, N) {
        rep(x, N) {
            if (x) cout << " ";
            cout << ((2 * x + N - y) % N + 1);
        } cout << endl;
    }

    return 0;
}