#include <bits/stdc++.h>
using namespace std;
int a[101][101];
int main() {
  int n, i, j, m, x;
  cin >> n;
  x = n, m = (1 + n * n) * n / 2;
  i = 1;
  while (x--) {
    for (j = 1; j <= n / 2; j++) {
      if (j == 1) {
        cout << i + j - 1 << ' ' << n * n + 1 - i - j + 1;
      } else {
        cout << ' ' << i + j - 1 << ' ' << n * n + 1 - i - j + 1;
      }
    }
    i = i + j - 1;
    cout << endl;
  }
  return 0;
}
