#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  vector<int> groups[n];
  int c = n * n;
  int it = 0;
  for (int i = 0; i < n; i++) {
    for (it = 0; it < n; it++) {
      groups[it].push_back(c);
      c--;
    }
    for (it = n - 1; it >= 0; it--) {
      groups[it].push_back(c);
      c--;
    }
  }
  for (int rows = 0; rows < n; rows++) {
    for (int values = 0; values < n; values++) {
      cout << groups[rows][values] << " ";
    }
    cout << '\n';
  }
}
