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