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