#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int all = n * n + 1;
  int now = 1;
  for (int i = 1; i <= all / 2; i++) {
    if (now != n / 2) {
      cout << i << ' ' << (all - i) << ' ';
      now++;
    } else {
      cout << i << ' ' << (all - i) << '\n';
      now = 1;
    }
  }
}
