#include <bits/stdc++.h>
using namespace std;
int n, c, inc, st;
int mat[305][305];
int main() {
  scanf("%d", &n);
  c = 1;
  for (int i = 1; i <= n; i++) {
    if (i % 2 == 0) {
      inc = 1;
      st = 1;
    } else {
      inc = -1;
      st = n;
    }
    for (int j = st; j >= 1 && j <= n; j += inc, c++) {
      mat[j][i] = c;
    }
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      printf("%d ", mat[i][j]);
    }
    printf("\n");
  }
}
