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