#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> v(n);
  int k = 0;
  for (int i = 0; i < n; i++) {
    int ost = i + 1;
    k = 0;
    int r = 0;
    for (int j = 1; j * 2 < n + 1; j++) {
      cout << k + ost << ' ';
      k += n;
      r += 1;
    }
    ost = (n + 1 - ost);
    for (int j = 1; j <= (n - r); j++) {
      cout << k + ost << ' ';
      k += n;
    }
    cout << '\n';
  }
  return 0;
}
