#include <bits/stdc++.h>
using namespace std;
int n, bags[10005];
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n;
  for (int i = 1; i <= pow(n, 2); i++) {
    bags[i] = i;
  }
  int minimum = 1;
  int maximum = pow(n, 2);
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n / 2; j++) {
      cout << bags[minimum] << " " << bags[maximum] << " ";
      minimum++;
      maximum--;
    }
    cout << endl;
  }
  return 0;
}
