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