#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, uk[301], flag = 0;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    uk[i] = i;
  }
  vector<vector<int> > v(n + 1);
  for (int i = 1; i <= n * n; i++) {
    if (flag) {
      for (int j = 1; j <= n / 2; j++) {
        swap(uk[j], uk[n + 1 - j]);
      }
      flag = 0;
    }
    v[uk[i % n + n * (i % n == 0)]].push_back(i);
    if (i % n == 0) flag = 1;
  }
  for (int i = 1; i <= n; i++) {
    for (auto x : v[i]) {
      cout << x << " ";
    }
    cout << "\n";
  }
  return 0;
}
