#include <bits/stdc++.h>
using namespace std;
vector<int> v[102];
int main() {
  int n, x, y, c = 1;
  cin >> n;
  x = 1;
  y = n * n;
  while (x < y) {
    if (c > n) c = 1;
    v[c].push_back(x);
    v[c].push_back(y);
    c++;
    x++;
    y--;
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j < v[i].size(); j++) cout << v[i][j] << " ";
    cout << endl;
  }
}
