#include <bits/stdc++.h>
using namespace std;
int a[100][100];
int main(int argc, char *argv[]) {
  int n = 2;
  cin >> n;
  int bagSize = n * n;
  bool flag = true;
  for (int i = 0; i < bagSize; i++) {
    if (flag) {
      a[i / n][i % n] = i;
    } else {
      a[i / n][n - 1 - i % n] = i;
    }
    if (i % n == n - 1) {
      flag = !flag;
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      cout << a[j][i] + 1 << " ";
    }
    cout << endl;
  }
}
