#include <bits/stdc++.h>
using namespace std;
const int N = 1000010;
const int mod = 1000000007;
set<int> s[N];
long long a[N];
long long qpow(long long B, long long E) {
  long long A = 1;
  for (; E; E >>= 1, B = B * B % mod) E& 1 ? A = A * B % mod : 0;
  return A;
}
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n * n; i++) {
    int pos = (i - 1) / n;
    s[pos].insert(i);
  }
  int k = n;
  while (k--) {
    int fg = 1;
    for (int i = n - 1; i >= 0; i--) {
      if (fg) {
        printf("%d ", *(--s[i].end()));
        s[i].erase(--s[i].end());
      } else {
        printf("%d ", *(s[i].begin()));
        s[i].erase(s[i].begin());
      }
      fg ^= 1;
    }
    puts("");
  }
  return 0;
}
