#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') {
      f = -1;
    }
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + (ch - '0');
    ch = getchar();
  }
  return x * f;
}
inline long long readll() {
  long long x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') {
      f = -1;
    }
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + (ch - '0');
    ch = getchar();
  }
  return x * f;
}
int ans[305][305];
int main() {
  int n;
  scanf("%d", &n);
  int gc = n * 2 - 1;
  for (int i = 1; i <= n; i++) {
    ans[i][1] = i;
    for (int j = 2; j <= n; j++) {
      if (j % 2 == 0) {
        ans[i][j] = ans[i][j - 1] + gc;
      } else {
        ans[i][j] = ans[i][j - 1] + 2 * n - gc;
      }
    }
    gc -= 2;
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n - 1; j++) {
      printf("%d ", ans[i][j]);
    }
    printf("%d\n", ans[i][n]);
  }
  return 0;
}
