#include <bits/stdc++.h>
using namespace std;
void init() {
  freopen("../input.txt", "r", stdin);
  freopen("../output.txt", "w", stdout);
}
int debugCounter = 0;
void debug(const string &value = "") {
  cout << "Got here" << debugCounter++ << ", value: " << value << endl;
}
int main() {
  int n;
  cin >> n;
  int result[n][n];
  int row = 0;
  int col = 0;
  bool down = true;
  for (int i = n * n; i >= 1; i--) {
    result[row][col] = i;
    if (down) {
      row++;
      if (row == n) {
        row = n - 1;
        col++;
        down = false;
      }
    } else {
      row--;
      if (row == -1) {
        row = 0;
        col++;
        down = true;
      }
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      cout << result[i][j] << " ";
    }
    cout << endl;
  }
  return 0;
}
