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