#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const int mx = 5e2 + 100;
int ma[mx][mx];
int main() {
  int n, m;
  scanf("%d", &n);
  int to = 1;
  bool f = 0;
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < n; ++j) {
      if (f)
        ma[j][i] = to++;
      else
        ma[n - j - 1][i] = to++;
    }
    f = f ^ 1;
  }
  for (int i = 0; i < n; ++i) {
    printf("%d", ma[i][0]);
    for (int j = 1; j < n; ++j) printf(" %d", ma[i][j]);
    puts("");
  }
  return 0;
}
