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