#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, j, last = 0, flag = 0;
  cin >> n;
  last = n * n;
  vector<int> v[n + 1];
  j = 1;
  for (i = 1; i <= last; i++) {
    if (!flag)
      v[j++].push_back(i);
    else {
      v[j--].push_back(i);
    }
    if (i % n == 0) {
      if (!flag) {
        flag = 1;
        j = n;
      } else {
        flag = 0;
        j = 1;
      }
    }
  }
  for (i = 1; i <= n; i++) {
    for (j = 0; j < v[i].size(); j++) {
      cout << v[i][j];
      if (j < (v[i].size() - 1)) cout << " ";
    }
    cout << endl;
  }
  return 0;
}
