#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n;
  cin >> n;
  long long int sum = n * n + 1;
  long long int first = 1, last = n * n;
  for (long long int i = 1; i <= n; i++) {
    for (long long int j = 0; j < n / 2; j++) {
      cout << first << " " << last << " ";
      first++;
      last--;
    }
    cout << endl;
  }
  return 0;
}
