#include <bits/stdc++.h>
using namespace std;
vector<int> v;
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n * n; i++) v.push_back(i);
  auto b = v.begin();
  auto e = v.end();
  e--;
  int noi = int((v).size()) / n;
  int k = noi / 2;
  while (noi--) {
    for (int i = 0; i < k; i++) {
      cout << *b << " ";
      cout << *e;
      b++;
      e--;
      if (i + 1 != k) cout << " ";
    }
    cout << endl;
  }
}
