#include <bits/stdc++.h>
long long int n, m, mn, mx, i, j, k;
using namespace std;
long long int ds(long long int n) {
  long long int ss = 0;
  while (n) {
    ss += n % 10;
    n /= 10;
  }
  return ss;
}
int nss(int n) {
  int ss = 0;
  while (n) {
    ss += (n % 10) * (n % 10);
    n /= 10;
  }
  return ss;
}
bool happyn(int n) {
  int s, f;
  s = f = n;
  do {
    s = nss(s);
    f = nss(nss(f));
  } while (s != f);
  return (s == 1);
}
int findmaxsum(int *a, int n) {
  int inc = a[0];
  int exl = 0;
  int exl_new;
  int i;
  for (i = 1; i < n; i++) {
    exl_new = (inc > exl) ? inc : exl;
    inc = exl + a[i];
    exl = exl_new;
  }
  return ((inc > exl) ? inc : exl);
}
int maxor(int a, int n) {
  int maxi = 0, mask = 0;
  set<int> s;
  for (int i = 0; i < n; i++) {
    mask |= (1 << i);
    for (int j = 0; j < n; j++) {
    }
    int newmax = maxi | (1 << i);
  }
}
int A(int a, int b, int c) {
  int r = min(a, b / 2);
  a -= r;
  b -= 2 * r;
  r += min(b, c / 2);
  return r;
}
int B(int a, int b, int c) {
  int r = min(b, c / 2);
  b -= r;
  c -= 2 * r;
  r += min(a, b / 2);
  return r;
}
int C(int a, int b, int c) { return max(A(a, b, c), B(a, b, c)); }
int powf(long long int a, long long int p) {
  long long int ans = 1;
  while (p) {
    if (p & 1) ans = (ans * a) % 1000000007;
    p >>= 1;
    a = (a * a) % 1000000007;
  }
  return ans % 1000000007;
}
const int maxn = 2e4;
int a[maxn];
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n / 2; i++) a[i] = n * (i - 1) + 1;
  for (int i = n / 2 + 1; i <= n; i++) a[i] = i * n;
  for (int i = 0; i < n; i++) {
    for (int j = 1; j <= n / 2; j++) {
      cout << a[j] + i << " ";
    }
    for (int j = n / 2 + 1; j <= n; j++) {
      if (j == n)
        cout << a[j] - i << endl;
      else
        cout << a[j] - i << " ";
    }
  }
}
