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