#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int grid[n][n];
  int nro = 1;
  for (int i = 0; i < n; i++) {
    if (!(i & 1))
      for (int j = 0; j < n; j++) grid[j][i] = nro++;
    else
      for (int j = 0; j < n; j++) grid[n - 1 - j][i] = nro++;
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) cout << grid[i][j] << " ";
    cout << endl;
  }
}
