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