#include <bits/stdc++.h>
using namespace std;
int main() {
  int number_of_bro;
  cin >> number_of_bro;
  int number_of_bags = number_of_bro * number_of_bro;
  int i = 0;
  int k = 0;
  for (int j = 1; j <= number_of_bags / 2; ++j) {
    ++k;
    cout << j << " " << number_of_bags - i << " ";
    ++i;
    if (k == number_of_bro / 2) {
      k = 0;
      cout << endl;
    }
  }
  return 0;
}
