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