#include <bits/stdc++.h>
using namespace std;
const unsigned long long int mod = 1000000007;
int main() {
  long long n;
  cin >> n;
  vector<long long> a(n * n);
  long long grp = 1, f = -1;
  for (int i = 0; i < n * n; ++i) {
    if (i % n == 0) {
      grp += f;
      f *= -1;
    }
    grp += f;
    a[i] = grp;
  }
  for (int i = 1; i <= n; ++i) {
    for (int j = 0; j < n * n; ++j) {
      if (a[j] == i) {
        cout << j + 1 << " ";
      }
    }
    cout << endl;
  }
}
