#include <bits/stdc++.h>
using namespace std;
const int N = 310, mod = 1e9 + 7, INF = 0x3f3f3f3f;
const double eps = 1e-6;
int n;
int a[N][N];
int main() {
  cin >> n;
  int tot = 0;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      if (i % 2 == 1)
        a[j][i] = ++tot;
      else
        a[n - j + 1][i] = ++tot;
    }
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      printf("%d ", a[i][j]);
    }
    puts("");
  }
  return 0;
}
