#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<vector<int> > v;
  int flag = 0;
  for (int i = 0; i < n * n; i += n) {
    vector<int> x;
    for (int j = 0; j < n; j++) {
      x.push_back(i + j + 1);
    }
    if (flag == 0) {
      v.push_back(x);
      flag = 1;
    } else {
      reverse(x.begin(), x.end());
      v.push_back(x);
      flag = 0;
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      cout << v[j][i] << " ";
    }
    cout << endl;
  }
}
