#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  int n;
  cin >> n;
  for (int i = 0; i < int(n); i++) {
    for (int j = 0; j < int(n); j++) {
      if (j % 2 == 0)
        cout << (j * n) + i + 1 << " ";
      else
        cout << ((j + 1) * n) - i << " ";
    }
    cout << "\n";
  }
}
