#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  cin >> n;
  int mat[n][n];
  int k = 1;
  for (int j = 0; j < n; j++) {
    if (j % 2 == 0) {
      for (int i = 0; i < n; i++) {
        mat[i][j] = k++;
      }
    } else {
      for (int i = n - 1; i >= 0; i--) {
        mat[i][j] = k++;
      }
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      cout << mat[i][j] << " ";
    }
    cout << endl;
  }
  return 0;
}
