#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> v;
  for (int i = 1; i <= n * n / 2; i++) {
    v.push_back(i);
    v.push_back(n * n - i + 1);
  }
  int i = 0;
  for (auto it : v) {
    cout << it << " ";
    i++;
    if (i == n) {
      cout << endl;
      i = 0;
    }
  }
}
