#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long n;
  cin >> n;
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < n / 2; j++) {
      cout << (i * n / 2) + j + 1 << " " << (n * n - (i * n / 2) - j) << " ";
    }
    cout << endl;
  }
}
