#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
const int mod = 1000000007;
const vector<int> mods = {998244353, 1000000007, 1000000009};
const long long inf = 3e18;
const double eps = 0.0000001;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int main() {
  cin.sync_with_stdio(0);
  cin.tie(0);
  cout.precision(13);
  long long n;
  cin >> n;
  for (long long i = (0); i < (n); ++i)
    for (long long j = (0); j < (n); ++j)
      cout << (j * n + ((j & 1) ? n - i : i + 1)) << " \n"[j == n - 1];
  return 0;
}
