#include <bits/stdc++.h>
using namespace std;
int main() {
  int a;
  cin >> a;
  int z = pow(a, 2) / a;
  int s = 0, f;
  vector<int> v;
  for (int i = 0, x = 1; i < pow(a, 2); i++, x++) {
    v.push_back(x);
  }
  f = v.size() - 1;
  for (int i = 0; i < a; i++) {
    for (int x = 0; x < z / 2; x++, s++) cout << v[s] << " ";
    for (int x = 0; x < z / 2; x++, f--) cout << v[f] << " ";
    cout << endl;
  }
  return 0;
}
