#include <bits/stdc++.h>
using namespace std;
int n;
int main() {
  cin >> n;
  int cnt = 0;
  int limit = n * n;
  for (int i = 1; i <= n; i++) {
    for (int j = i; j <= limit; j += n) {
      cnt++;
      if (cnt != n)
        printf("%d ", j);
      else {
        printf("%d", j);
        cnt = 0;
      }
      j++;
      if (j % n == 1) j -= n;
    }
    printf("\n");
  }
}
