#include #include #include #include #include #include #include #include #include #include #include #define rep(i,n) for(int (i) = 0; i < (n); i++) using namespace std; using ll = long long; using ull = unsigned long long; using ld = long double; //const ll mod = 1e9 + 7; const ll mod = 998244353; const int inf = 123456; int main(){ int n; cin >> n; vector a; for(int i = 1; i <= n; i+=2){ a.push_back(i); } for(int i = 2; i <= n; i+=2){ a.push_back(i); } vector b = a; for(int i = 0; i < a.size(); i++){ int j = a[i] - 1; int cnt = 0; while(cnt < n){ cout << b[j] << " "; cnt++; j++; if(j >= n){ j = 0; } } cout << endl; } return 0; }