#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, j, flag = 0;
  int a[102][102];
  while (cin >> n) {
    for (i = 0; i < n; i++)
      for (j = 1; j <= n; j++) a[i][j - 1] = i * n + j;
    for (i = 0; i < n; i++) {
      flag = 0;
      for (j = 0; j < n; j++) {
        if (flag == 0) {
          flag = 1;
          cout << a[j][(j + i) % n];
        } else
          cout << " " << a[j][(j + i) % n];
      }
      cout << endl;
    }
  }
  return 0;
}
