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