#include <bits/stdc++.h>
const unsigned int M = 1000000007;
using namespace std;
int main() {
  int n;
  cin >> n;
  for (int x = 1, y = n * n; x <= n * n / 2; x++, y--)
    cout << x << " " << y << endl;
  return 0;
}
