#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
long long qp(long long n, long long m) {
  long long res = 1;
  while (m) {
    long long a = m % 2;
    if (a) res = (res * a * n) % MOD;
    n = (n * n) % MOD;
    m = m / 2;
  }
  return res;
}
void solve() {
  int n;
  cin >> n;
  vector<vector<int>> re(n, vector<int>(n, 0));
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      re[i][j] = j * n + i + 1;
    }
  }
  for (int j = 0; j < n; j++) {
    if (j % 2 == 0) continue;
    for (int i = 0; i < n / 2; i++) {
      swap(re[i][j], re[n - 1 - i][j]);
    }
  }
  for (auto &item : re) {
    for (int j = 0; j < n; j++) {
      if (j) cout << " ";
      cout << item[j];
    }
    cout << endl;
  }
}
int main() {
  ios::sync_with_stdio(false);
  cout.tie(NULL);
  int T = 1;
  while (T--) {
    solve();
  }
  return 0;
}
