#include <bits/stdc++.h>
using namespace std;
const int ma = 305;
int mapp[ma][ma];
int n;
int main() {
  scanf("%d", &n);
  int num = 0;
  for (int i = n * n; i >= 1;) {
    if (num % 2 == 0) {
      for (int j = n - 1; j >= 0; j--) mapp[j][num] = i, i--;
    } else {
      for (int j = 0; j < n; j++) mapp[j][num] = i, i--;
    }
    num++;
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) printf("%d ", mapp[i][j]);
    printf("\n");
  }
  return 0;
}
