#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
const int Inf = 1e9 + 1;
const int Mod = 1e9 + 7;
long long n, f, s;
int main() {
  ios_base ::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n;
  f = 1;
  s = n * n;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n / 2; j++) {
      cout << f << ' ' << s << ' ';
      f++;
      s--;
    }
    cout << "\n";
  }
  return 0;
}
