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