#include using namespace std; using ll = long long; constexpr char newl = '\n'; int main() { cin.tie(nullptr); ios::sync_with_stdio(false); int n; cin >> n; vector< vector > ans(n, vector(n)); for (int x = 1; x <= n; x++) { for (int i = 0; i < n; i++) { ans[i][(2 * (x - 1) - i + n) % n] = x; } } for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { cout << ans[i][j] << " \n"[j + 1 == n]; } } return 0; }