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