#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[]) {
  std::ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int n;
  cin >> n;
  long long int m = 2 * n;
  std::vector<long long int> v[n];
  for (long long int i = 0; i < n * n; i++) {
    if (i % m >= n) {
      v[(2 * n - (i % m)) - 1].push_back(i + 1);
    } else
      v[i % n].push_back(i + 1);
  }
  for (long long int i = 0; i < n; i++) {
    for (auto j : v[i]) {
      cout << j << " ";
    }
    cout << endl;
  }
  return 0;
}
