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