#include <bits/stdc++.h>
using namespace std;
int a[102][102];
int main() {
  int n, x, y, c1, c2;
  cin >> n;
  c1 = 1;
  c2 = n * n;
  for (x = 0; x < (n / 2); x++) {
    for (y = 0; y < n; y++) {
      a[y][x] = c1;
      c1++;
    }
  }
  for (x = n - 1; x >= (n / 2); x--) {
    for (y = 0; y < n; y++) {
      a[y][x] = c2;
      c2--;
    }
  }
  for (x = 0; x < n; x++) {
    for (y = 0; y < n; y++) {
      printf("%d ", a[x][y]);
    }
    cout << endl;
  }
  return 0;
}
