#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 100, delta = 1e9 + 7;
int main() {
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  vector<int> v[n + 1];
  for (int i = 0; i < n; i++) {
    cout << endl;
    if (!(i % 2)) {
      for (int j = 1; j <= n; j++) {
        v[i].push_back(j + n * i);
      }
      continue;
    }
    for (int j = n; j > 0; j--) {
      v[i].push_back(j + n * i);
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      cout << v[j][i] << ' ';
    }
    cout << endl;
  }
}
