#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  while (scanf("%d", &n) != EOF) {
    int sta = 1, end = n * n;
    for (int i = 1; i <= n; i++) {
      for (int j = 1; j <= n / 2; j++) {
        if (j == 1) {
          printf("%d", sta);
          sta++;
        } else {
          printf(" %d", sta);
          sta++;
        }
      }
      for (int j = 1; j <= n / 2; j++) {
        printf(" %d", end);
        end--;
      }
      printf("\n");
    }
  }
  return 0;
}
