#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a, even = 0, odd = 0;
  cin >> n;
  int f = 1, l = n * n;
  for (int i = 1; i <= n; i++) {
    int c = 0;
    while (c < n / 2) {
      cout << l << " ";
      cout << f << " ";
      f++;
      l--;
      c++;
    }
    cout << "\n";
  }
}
