/*** author: yuji9511 ***/ #include using namespace std; using ll = long long; using lpair = pair; const ll MOD = 1e9+7; const ll INF = 1e18; #define rep(i,m,n) for(ll i=(m);i<(n);i++) #define rrep(i,m,n) for(ll i=(m);i>=(n);i--) #define printa(x,n) for(ll i=0;i void print(H&& h, T&&... t){cout<(t)...);} void solve(){ ll N; cin >> N; ll ans[510][510] = {}; rep(i,0,N){ rep(j,0,N){ ans[i][j] = (i-j+N) % N + 1; } } rep(i,0,N){ rep(j,0,N){ cout << ans[i][j] << " \n"[j==N-1]; } } } int main(){ cin.tie(0); ios::sync_with_stdio(false); solve(); }