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