#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int c = n * n;
  int a[c];
  for (int i = 0; i < c; i++) {
    a[i] = i + 1;
  }
  int o = 0;
  int g = n * n;
  int count = 0;
  for (int i = 0; i < c; i++) {
    cout << a[i] << " " << a[g - i - 1] << " ";
    o += 2;
    if (o % n == 0) {
      cout << endl;
    }
    if (o == g) {
      break;
    }
  }
  return 0;
}
