#include <bits/stdc++.h>
using namespace std;
const long double pi = 3.1415926535897932384626433832795;
const long double eps = 1e-9;
deque<int> d;
int main() {
  int n, i, j, k;
  scanf("%d", &n);
  for (i = 1; i <= n * n; i++) {
    d.push_back(i);
  }
  int count = 0;
  for (i = 1; i <= n; i++) {
  L:
    j = d.front();
    k = d.back();
    printf("%d %d ", j, k);
    d.pop_front();
    d.pop_back();
    count = count + 2;
    if (count % n == 0)
      printf("\n");
    else
      goto L;
  }
  return 0;
}
