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