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