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