#include <bits/stdc++.h>
using namespace std;
int n;
int ans[105][105];
int main() {
  scanf("%d", &n);
  int p1 = 1;
  int p2 = n * n;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= n / 2; j++) {
      ans[i][j] = p1++;
      ans[i][j + n / 2] = p2--;
    }
  for (int i = 1; i <= n; i++) {
    printf("%d", ans[i][1]);
    for (int j = 2; j <= n; j++) printf(" %d", ans[i][j]);
    printf("\n");
  }
  return 0;
}
