#include <bits/stdc++.h>
using namespace std;
int i, j, x, n, maxState, group[301][301];
int main() {
  cin >> n;
  maxState = 1;
  x = n * n;
  for (i = 0; x > 0 && i < n; i++, maxState = 1 - maxState)
    if (maxState)
      for (j = 0; j < n; j++) group[i][j] = x--;
    else
      for (j = n - 1; j >= 0; j--) group[i][j] = x--;
  for (i = 0; i < n; i++) {
    for (j = 0; j < n - 1; j++) cout << group[j][i] << " ";
    cout << group[n - 1][i] << endl;
  }
  return 0;
}
