#include <bits/stdc++.h>
int main() {
  int n;
  scanf("%d", &n);
  int a = 1, dem = 0, b = 0;
  for (int i = n * n - 1; i >= 0; i--) {
    printf("%d ", a);
    if (dem % 2 == 0)
      a += i;
    else
      a -= i;
    b++;
    if (b == n) {
      printf("\n");
      b = 0;
    }
    dem++;
  }
}
