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