#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  while (cin >> n) {
    if (n & 1) {
      int i = 1, j = 1;
      vector<int> L[110];
      while (j <= n * n) {
        L[i].push_back(j);
        if (j % n) i--;
        if (i == 0) i = n;
        j++;
      }
      for (i = 1; i <= n; i++) {
        for (j = 0; j < L[i].size(); j++) cout << L[i][j] << " ";
        cout << endl;
      }
      continue;
    }
    int i;
    int per = n * (n * n + 1) / 2;
    vector<int> L[110];
    int j = 1, d = 1;
    for (i = 1; i <= n * n; i++) {
      L[j].push_back(i);
      j += d;
      if (j == n + 1) {
        d = -d;
        j = n;
      }
      if (j == 0) {
        d = -d;
        j = 1;
      }
    }
    for (i = 1; i <= n; i++) {
      for (j = 0; j < L[i].size(); j++) cout << L[i][j] << " ";
      cout << endl;
    }
  }
  return 0;
}
