#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int arr[n][n];
  int num = 1, start = 0, end = 2;
  for (int i = 0; i < n; ++i) {
    if (i % 2 == 0) {
      for (int j = 0; j < n; ++j) {
        arr[j][i] = num;
        num++;
      }
    } else {
      for (int j = n - 1; j >= 0; --j) {
        arr[j][i] = num;
        num++;
      }
    }
  }
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < n; ++j) {
      cout << arr[i][j] << " ";
    }
    cout << endl;
  }
  return 0;
}
