#include <bits/stdc++.h>
int main() {
  int n;
  std::scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < n; ++j) {
      std::printf("%d ", j * n + (j % 2 == 0 ? i : n - i - 1) + 1);
    }
    std::printf("\n");
  }
  return 0;
}
