#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
long long binpow(long long a, long long b) {
  long long ret = 1;
  while (b) {
    if (b & 1) ret *= a;
    a *= a;
    b >>= 1;
    a %= mod;
    ret %= mod;
  }
  return ret;
}
signed main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  vector<long long> val(n);
  val[0] = 1;
  val[1] = 2 * n;
  for (long long i = 2; i < n; i++) {
    if (i % 2 == 0) {
      val[i] = val[i - 1] + 1;
    } else {
      val[i] = val[i - 2] + 2 * n;
    }
  }
  for (long long i = 0; i < n; i++) {
    for (auto a : val) cout << a << ' ';
    cout << '\n';
    for (long long i = 0; i < n; i++) {
      val[i] += (i % 2 == 0 ? 1 : -1);
    }
  }
}
