#include <bits/stdc++.h>
using namespace std;
unsigned long long gcd(unsigned long long a, unsigned long long b) {
  unsigned long long c;
  while (a != 0) {
    c = a;
    a = b % a;
    b = c;
  }
  return b;
}
void printSet(set<int> s) {
  for (int i : s) {
    cout << i << " ";
  }
  cout << "\n";
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  long long n;
  while (cin >> n) {
    vector<int> bag(n * n);
    long long sq = n * n;
    long long each = (sq * (sq + 1)) / (2 * n);
    vector<int> vs[n];
    for (int i = 1; i <= n * n; i++) {
      bag[i - 1] = i;
    }
    for (int i = 0, j = n * n - 1; i < j; i++, j--) {
      vs[i % n].push_back(bag[i]);
      vs[i % n].push_back(bag[j]);
    }
    for (int i = 0; i < (n); i++) {
      for (int j = 0; j < (n); j++) {
        cout << vs[i][j] << " ";
      }
      cout << "\n";
    }
  }
  return 0;
}
