#include <bits/stdc++.h>
using namespace std;
const int maxn = 300 + 5;
const int inf = 0x3f3f3f3f;
const long long INF = 0x3f3f3f3f3f3f3f3f;
int a[maxn][maxn];
int main(void) {
  int n;
  scanf("%d", &n);
  int m = n * n;
  int f = 1, t = 1;
  for (int k = 1; k <= n; ++k) {
    for (int i = 1; i <= n; ++i) {
      if (f == 1) {
        a[i][k] = t;
        t++;
      } else {
        a[n - i + 1][k] = t;
        t++;
      }
    }
    f ^= 1;
  }
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= n; ++j) {
      if (j != 1) printf(" ");
      printf("%d", a[i][j]);
    }
    printf("\n");
  }
  return 0;
}
