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