#include <bits/stdc++.h>
using namespace std;
int a[100005], i, m, ans, k, l, j, q, x, n, ma, mi;
string s;
int main() {
  cin >> n;
  for (i = 1; i <= n; i++) {
    for (j = 0; j < n; j++)
      if (i + (j * n + j) <= (j + 1) * n)
        cout << i + (j * n + j) << " ";
      else
        cout << i + (j * n + j) - n << " ";
    cout << endl;
  }
}
