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