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