#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int bn = n >> 1;
  int nn = n * n;
  for (int i = 1; i <= n; i++) {
    for (int b = 0; b < bn; b++) {
      cout << " ";
      int t1 = b * n + i;
      int t2 = nn - t1 + 1;
      cout << t1 << " " << t2;
    }
    cout << endl;
  }
  return 0;
}
