#include <bits/stdc++.h>
using namespace std;
const int maxn = 5e5 + 10;
int a[330][330];
int main() {
  int n;
  scanf("%d", &n);
  int len = n / 2;
  int now = n * n;
  if (n & 1) {
    for (int i = 1; i <= n; i++) {
      for (int j = 1; j <= len; j++) {
        a[i][j] = now;
        now--;
      }
    }
    len++;
    for (int i = 1; i <= n; i++) {
      a[i][len] = now;
      now--;
    }
    len++;
    for (int i = n; i >= 1; i--) {
      for (int j = len; j <= n; j++) {
        a[i][j] = now;
        now--;
      }
    }
  } else {
    for (int i = 1; i <= n; i++) {
      for (int j = 1; j <= len; j++) {
        a[i][j] = now;
        now--;
      }
    }
    len++;
    for (int i = n; i >= 1; i--) {
      for (int j = len; j <= n; j++) {
        a[i][j] = now;
        now--;
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      printf("%d ", a[i][j]);
    }
    printf("\n");
  }
  return 0;
}
