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