#include using namespace std; #define rep(i,n) for(int i = 0; i < (n);i++) #define sz(x) int(x.size()) typedef long long ll; typedef pair P; constexpr int INF = 1e9; int main() { int n; cin >> n; rep(i,n) { rep(j,n) cout << (2 * i - j + n) % n + 1 << " "; cout << endl; } return 0; }