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