#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  int p = 1;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n / 2; j++) {
      cout << p << " " << n * n - p + 1 << "\n";
      p++;
    }
  }
  return 0;
}
