#include using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) #define ALL(v) (v).begin(), (v).end() using ll = long long; constexpr int INF = 1e9; constexpr long long LINF = 1e18; constexpr long long MOD = 1e9 + 7; signed main() { int n; cin >> n; int a[n][n]; rep(i, n) { rep(j, n) { a[(i + j) % n][(i - j + n) % n] = i + 1; } } rep(i, n) { rep(j, n) { if(j) cout << " "; cout << a[i][j]; } cout << endl; } return 0; }