#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  int it = 1, ma[n + 1][n + 1];
  for (int j = 1; j <= n; j++) {
    if (j & 1) {
      for (int i = 1; i <= n; i++) ma[i][j] = it++;
    } else {
      for (int i = n; i > 0; i--) ma[i][j] = it++;
    }
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) cout << ma[i][j] << " ";
    cout << endl;
  }
}
