#include <bits/stdc++.h>
#pragma GCC target("avx2")
#pragma GCC optimization("O3")
#pragma GCC optimization("unroll-loops")
using namespace std;
bool wziete[305][305];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cout << i << " ";
    for (int j = 2; j <= n; j++) {
      if (j % 2 == 0) {
        for (int k = n; k >= 1; k--) {
          if (!wziete[j][k]) {
            wziete[j][k] = true;
            cout << (j - 1) * n + k << " ";
            break;
          }
        }
      } else {
        for (int k = 1; k <= n; k++) {
          if (!wziete[j][k]) {
            wziete[j][k] = true;
            cout << (j - 1) * n + k << " ";
            break;
          }
        }
      }
    }
    cout << "\n";
  }
  return 0;
}
