#include <bits/stdc++.h>
using namespace std;
int ABS(int a) { return max(a, -a); }
long long ABS(long long a) { return max(a, -a); }
double ABS(double a) { return max(a, -a); }
void solve() {
  int n;
  cin >> n;
  int l = 1, r = n * n;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= (n / 2); j++) {
      cout << l << " " << r << " ";
      l++, r--;
    }
    cout << "\n";
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  while (t--) solve();
}
