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