#include <bits/stdc++.h>
using namespace std;
int main() {
  int t, cnt = 1, ans[400][400];
  cin >> t;
  for (int i = 1; i <= t; i++) {
    if (i % 2 == 0) {
      for (int j = t; j >= 1; j--) ans[j][i] = cnt++;
    } else {
      for (int j = 1; j <= t; j++) ans[j][i] = cnt++;
    }
  }
  for (int i = 1; i <= t; i++) {
    for (int j = 1; j <= t; j++) cout << ans[i][j] << " ";
    cout << endl;
  }
}
