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