#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int arr[10002];
  int sum = 0;
  int seedha[100001], ulta[100002];
  int power = pow(n, 2);
  for (int i = 1; i <= power; i++) {
    seedha[i] = i;
  }
  for (int i = 1; i <= power; i++) {
    ulta[i] = pow(n, 2) - (i - 1);
  }
  for (int k = 1; k <= n; k++) {
    for (int i = k; i <= (n / 2) * n; i += n) {
      cout << seedha[i] << " " << ulta[i] << " ";
    }
    cout << endl;
  }
}
