#include <bits/stdc++.h>
using namespace std;
long long int ar[1000][1000];
long long ans[1000];
string asl[1000000];
int main() {
  long long n, m, i, j, a, b, c, d, e, f, g, l, h, maxx, q;
  string s, t, o;
  char ch, ch1;
  double p, y, x, u;
  while (cin >> n) {
    j = 0;
    for (i = 0; i < n * n; i++) {
      if (i % n == 0) j++;
      ar[i % n][j] = i + 1;
    }
    for (i = 0; i < n / 2; i++) {
      a = 0;
      for (j = 1; j <= n; j++) {
        if (j % 2 == 0) {
          cout << ar[i][j] << " ";
          ans[a++] = ar[n - i - 1][j];
        } else {
          cout << ar[n - i - 1][j] << " ";
          ans[a++] = ar[i][j];
        }
      }
      cout << endl;
      for (j = 0; j < a; j++) {
        cout << ans[j] << " ";
      }
      cout << endl;
    }
    if (n % 2 == 1)
      for (i = 1; i <= n; i++) {
        cout << ar[n / 2][i] << " ";
      }
    cout << endl;
  }
}
