#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const long long INF = 0xffffffffffffff;
const int N = 300 + 5;
const int mod = 998244353;
int main() {
  int n, ans;
  scanf("%d", &n);
  int tp = 1, sttp = 1, ip = 0;
  for (int i = 1; i <= n; i++) {
    tp = sttp;
    if (tp > 0) ip++;
    for (int j = 1; j <= n; j++, tp = -tp) {
      if (tp > 0)
        ans = (j - 1) * n + ip;
      else
        ans = j * n - ip + 1;
      printf("%d%c", ans, " \n"[j == n]);
    }
    sttp = -sttp;
  }
  return 0;
}
