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