#include <bits/stdc++.h>
using namespace std;
int n, sn, i, j, sum, temp, nl;
map<int, int> myMap;
vector<int> t[105];
int main() {
  cin >> n;
  j = 0;
  sn = n * n;
  for (i = sn; i > sn / 2; i--) {
    t[j % n].push_back(i);
    t[j % n].push_back(sn - i + 1);
    j++;
  }
  for (i = 0; i < n; i++) {
    nl = t[i].size();
    for (j = 0; j < nl; j++) cout << t[i][j] << " ";
    cout << endl;
  }
  return 0;
}
