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