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