#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long n;
  cin >> n;
  long long x = n * (n * n + 1) / 2;
  vector<long long> a[101];
  for (long long j = 0; j < n / 2; j++)
    for (long long i = 1; i < n + 1; i++) {
      long long x = n * j + i;
      a[i].push_back(x);
      a[i].push_back(n * n - x + 1);
    }
  for (long long i = 1; i < n + 1; i++) {
    for (auto x : a[i]) cout << x << " ";
    cout << '\n';
  }
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long TESTS = 1;
  while (TESTS--) {
    solve();
  }
  return 0;
}
