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