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