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