#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int p = 0;
  int temp = n * n;
  int arr[n][n];
  while (p <= n - 1) {
    for (int q = 0; q < n; q++) {
      arr[q][p] = temp;
      temp--;
    }
    p++;
    if (p > n - 1) {
      break;
    }
    for (int q = n - 1; q >= 0; q--) {
      arr[q][p] = temp;
      temp--;
    }
    p++;
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      cout << arr[i][j] << " ";
    }
    cout << endl;
  }
}
