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