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