#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  vector<vector<int> > bags(n + 1);
  int bag = 1;
  while (bag <= n * n) {
    for (int i = 1; i <= n; i++) {
      bags[i].push_back(bag);
      bag++;
    }
    for (int i = n; i >= 1; i--) {
      bags[i].push_back(bag);
      bag++;
    }
  }
  for (int i = 1; i < bags.size(); i++) {
    cout << bags[i][0];
    for (int j = 1; j < n; j++) cout << " " << bags[i][j];
    cout << endl;
  }
}
