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