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