#include <bits/stdc++.h>
using namespace std;
const int OO = (int)1e8;
const double EPS = 1e-11;
int main() {
  int n;
  cin >> n;
  int f = 1, t = n * n;
  for (int i = 0; i < n; ++i) {
    for (int k = 0; k < n / 2; ++k) cout << (k ? " " : "") << f++;
    int tmp = t - n / 2 + 1;
    for (int k = 0; k < n / 2; ++k) cout << " " << tmp++, t--;
    cout << endl;
  }
  return 0;
}
