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