/** * author: boutarou * created: 14.08.2020 21:25:02 **/ #include using namespace std; #define rep(i,n) for(int i = 0; i < int(n); i++) using ll = long long; using P = pair; int main() { int n; cin >> n; vector> ans(n, vector(n)); int now = 0; rep(i,n) { int res = now; rep(j,n) { ans[i][res] = j + 1; res--; if (res < 0) res += n; } now += 2; if (now >= n) now -= n; } rep(i,n) { rep(j,n) { cout << ans[i][j] << " "; } cout << endl; } return 0; }