#include <bits/stdc++.h>
using namespace std;
const int MA = 500;
int a[MA][MA];
int main() {
  int n, t = 0;
  scanf("%d", &n);
  int num = 1;
  while (num <= n * n) {
    t++;
    for (int i = 1; i <= n; ++i) {
      a[i][t] = num++;
    }
    t++;
    for (int i = n; i >= 1; --i) {
      a[i][t] = num++;
    }
  }
  for (int i = 1; i <= n; ++i) {
    printf("%d", a[i][1]);
    for (int j = 2; j <= n; ++j) {
      printf(" %d", a[i][j]);
    }
    printf("\n");
  }
  return 0;
}
