#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, j, sum;
  vector<int> v[105];
  while (scanf("%d", &n) == 1) {
    sum = (n * (n + 1)) / 2;
    int p = 1, x = 0;
    for (i = 1; i <= n; i++) {
      if (p == 1) {
        for (j = 1; j <= n; j++) v[j].push_back(++x);
        p = 2;
      } else {
        for (j = n; j >= 1; j--) v[j].push_back(++x);
        p = 1;
      }
    }
    for (i = 1; i <= n; i++) {
      for (j = 0; j < v[i].size(); j++) {
        if (j == 0)
          printf("%d", v[i][j]);
        else
          printf(" %d", v[i][j]);
      }
      printf("\n");
    }
    for (i = 0; i <= n; i++) v[i].clear();
  }
  return 0;
}
