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