#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n;
  m = n;
  for (int i = 1, j = n * n; i < j; i++, j--, m -= 2) {
    if (m == 0) {
      cout << endl;
      m = n;
    }
    cout << i << " " << j << " ";
  }
}
