#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, b, c;
  cin >> n;
  b = n * n;
  vector<int> v;
  vector<int>::iterator it;
  for (int i = 1; i <= b; i++) {
    v.push_back(i);
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n / 2; j++) {
      cout << v[0] << " ";
      c = v.size() - 1;
      cout << v[c] << " ";
      v.erase(v.begin());
      v.pop_back();
    }
    cout << endl;
  }
}
