#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  long long int mx = n * n;
  for (int i = 1, j = mx; i < j; i++, j--) {
    cout << i << " " << j << endl;
  }
}
