#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int p = n / 2;
  if (n % 2) {
    int i;
    for (i = 1; i <= n; i++) {
      int x = i;
      int y = 2 * n;
      y = y - i + 1;
      int j;
      for (j = 0; j < p; j++) {
        cout << x + (j * 2 * n) << " ";
        cout << y + (j * 2 * n) << " ";
      }
      j = p;
      cout << x + (j * 2 * n) << " ";
      cout << endl;
    }
  } else {
    int i;
    for (i = 1; i <= n; i++) {
      int x = i;
      int j;
      int y = 2 * n;
      y = y - i + 1;
      for (j = 0; j < p; j++) {
        cout << x + (j * 2 * n) << " ";
        cout << y + (j * 2 * n) << " ";
      }
      cout << endl;
    }
  }
  return 0;
}
