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