#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[n][n];
  int k = 1, j = 0;
  for (int i = 0; i < n; i++) {
    while (j < n && j >= 0) {
      a[j][i] = k++;
      j += (i % 2 == 0 ? 1 : -1);
    }
    j = (j == -1 ? 0 : n - 1);
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) cout << a[i][j] << " ";
    cout << "\n";
  }
  return 0;
}
