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