#include <bits/stdc++.h>
int main() {
  int n, m, i, j, k;
  int s[110][110];
  scanf("%d", &n);
  m = 1;
  for (i = 0; i < n; i++)
    for (j = 0; j < n; j++) {
      s[i][j] = m;
      m++;
    }
  for (j = 0; j < n; j++) {
    k = j;
    for (i = 0; i < n; i++) {
      if (k < 0) k = n - 1;
      if (i == n - 1)
        printf("%d\n", s[i][k]);
      else
        printf("%d ", s[i][k]);
      k--;
    }
  }
  return 0;
}
