#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int b = 1, e = n * n;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n / 2; j++) {
      cout << b << " " << e << " ";
      b++;
      e--;
    }
    cout << endl;
  }
  return 0;
}
