#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-9;
const double pi = acos(-1.0);
int n;
int main() {
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= n; ++j) {
      int start = j * n - n, end = start + n;
      if (j % 2 == 0) {
        printf("%d ", end - i + 1);
      } else {
        printf("%d ", i + start);
      }
    }
    puts("");
  }
  return 0;
}
