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