#include <bits/stdc++.h>
using namespace std;
int getMax(int n) {
  int sum = 0;
  for (int i = 1; i <= n * n; i++) {
    sum += i;
  }
  return sum;
}
int main() {
  int n;
  cin >> n;
  int stk = 0;
  int max = getMax(n);
  for (int i = 0; i < n; i++) {
    int sum = 0;
    while (sum != max / n) {
      cout << 1 + stk << " " << n * n - stk << " ";
      sum += 1 + stk + (n * n - stk);
      stk++;
    }
    cout << endl;
  }
}
