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