#include <bits/stdc++.h>
using namespace std;
const int maxn = 100 + 10;
int a[maxn][maxn];
int main() {
  int n, j, i, cnt, k;
  while (scanf("%d", &n) != EOF) {
    memset(a, 0, sizeof(a));
    int t, g, x = n / 2;
    for (i = 1; i <= x; i++) a[1][i] = i;
    for (j = n * n - x + 1; j <= n * n; j++) a[1][i++] = j;
    for (i = 1; i <= n; i++) {
      g = 0;
      for (j = i * x + 1; j <= i * x + x; j++) a[i + 1][++g] = j;
      for (k = n * n - (i + 1) * x + 1; k <= n * n - i * x; k++)
        a[i + 1][++g] = k;
    }
    for (i = 1; i <= n; i++) {
      for (j = 1; j <= n; j++) {
        printf("%d", a[i][j]);
        if (j != n)
          printf(" ");
        else
          printf("\n");
      }
    }
  }
  return 0;
}
