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