#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, j, n, sq, num = 1;
  cin >> n;
  int ar[400][400];
  for (i = 1; i <= n; i++) {
    if (i % 2) {
      for (j = 1; j <= n; j++) ar[j][i] = num++;
    } else {
      for (j = n; j >= 1; j--) ar[j][i] = num++;
    }
  }
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= n; j++) {
      cout << ar[i][j] << " ";
    }
    cout << endl;
  }
  return 0;
}
