#include <bits/stdc++.h>
int main() {
  int n, m, x, y, j, i, k, ii, jj;
  scanf("%d", &n);
  x = n * n;
  if (n % 2 == 0)
    for (i = 1; i <= x / 2 - n / 2 + 1; i += n / 2) {
      for (j = i; j < i + n / 2; j++) {
        printf("%d %d", j, x - j + 1);
        if (j + 1 < i + n / 2) printf(" ");
      }
      printf("\n");
    }
  else {
    printf("%d", x / 2 + 1);
    for (i = 1; i <= n / 2; i++) printf(" %d %d", i, x - i + 1);
    printf("\n");
    j = x / 2 + 2;
    for (k = 1; k < n; k++) {
      for (ii = 0; ii < k; ii++) {
        printf("%d ", i);
        i++;
      }
      for (ii = 0; ii < n - k; ii++) {
        printf("%d", j);
        j++;
        if (ii + 1 < n - k) printf(" ");
      }
      printf("\n");
    }
  }
  return 0;
}
