#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int arr[n][n];
  int i = 0, j = 0;
  int k = 1;
  bool flag = false;
  while (k <= n * n) {
    arr[i][j] = k++;
    if (!flag) {
      i++;
    } else {
      i--;
    }
    if (i == n) {
      i = n - 1;
      flag = true;
      j++;
    }
    if (i < 0) {
      i = 0;
      flag = false;
      j++;
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      cout << arr[i][j] << " ";
    }
    cout << endl;
  }
  cout << endl;
  return 0;
}
