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