#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int k[n][n];
  for (int j = 0; j < n; j++)
    for (int i = 0; i < n; i++) k[i][j] = (i)*n + j + 1;
  for (int i = 0; i < n; i += 2) reverse(k[i], k[i] + n);
  for (int j = n - 1; j >= 0; j--) {
    for (int i = 0; i < n; i++) cout << k[i][j] << ' ';
    cout << endl;
  }
  return 0;
}
