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