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