#include #define rep(i,n) for(ll i=0;i<(n);++i) #define all(a) (a).begin(),(a).end() using namespace std; using Graph = vector>; typedef pair P; typedef long long ll; int main(){ ll n; cin >> n; rep(h,n){ rep(w,n){ ll res = (2*h + 1) % n - w; if(res <= 0) res += n; cout << res << " "; } cout << endl; } }