#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e18, mxn = 1e5 + 5;
void solve() {
  long long n, cnt = 1;
  bool f = true;
  cin >> n;
  vector<vector<long long> > res(n, vector<long long>(n));
  for (long long i = 0; i < n; i++) {
    if (f) {
      f = !f;
      for (long long j = 0; j < n; j++) {
        res[j][i] = cnt++;
      }
    } else {
      f = !f;
      for (long long j = n - 1; j >= 0; j--) {
        res[j][i] = cnt++;
      }
    }
  }
  for (auto &i : res) {
    for (auto &j : i) cout << j << ' ';
    cout << '\n';
  }
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  solve();
}
