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