#include <bits/stdc++.h>
using namespace std;
int main() {
  int x;
  scanf("%d", &x);
  for (int i = 1; i <= x * x / 2; ++i) {
    cout << i << " " << (x * x - i + 1);
    cout << "\n";
  }
  return 0;
}
