#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 11, INF = 1e9;
int n;
int main() {
  scanf("%d", &n);
  int l = 1, r = n * n;
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= (n >> 1); ++j) {
      printf("%d %d ", l, r);
      ++l;
      --r;
    }
    printf("\n");
  }
  return 0;
}
