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