#include #include using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define all(x) (x).begin(), (x).end() #define ll long long #define ld long double #define INF 1000000000000000000 typedef pair pll; int main() { cin.tie(0); ios::sync_with_stdio(false); int N; cin >> N; vector A(N); rep(i, N) { A[i] = i + 1; } for (int i = 0; i < N; i++) { vector A(N); int ma = N; rep(j, N) { if (ma == i + 1) ma--; if (i == j) { cout << i + 1 << " "; } else { cout << ma << " "; ma -= 1; } } cout << endl; } return 0; }