#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, j, c = 1;
  cin >> n;
  for (i = 1; i <= n; i++) {
    for (j = 0; j < n; j += 2)
      cout << n * j + i << " " << n * j + 2 * n - i + 1 << " ";
    cout << endl;
  }
  return 0;
}
