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