#include <bits/stdc++.h>
using namespace std;
const int N = 300 + 5;
int a[N][N];
int main() {
  int n;
  scanf("%d", &n);
  int cnt = 0;
  for (int col = 0; col < n; col++) {
    for (int row = (col & 1 ? n - 1 : 0); (col & 1 ? row >= 0 : row < n);
         row += (col & 1 ? -1 : +1)) {
      a[row][col] = ++cnt;
    }
  }
  for (int row = 0; row < n; row++) {
    for (int col = 0; col < n; col++) {
      printf("%d%c", a[row][col], col == n - 1 ? '\n' : ' ');
    }
  }
  return 0;
}
