#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const int N = 1e6 + 5;
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
long long lcm(long long a, long long b) { return a * b / gcd(a, b); }
inline long long qsm(long long x, long long y) {
  long long res = 1;
  while (y) {
    if (y & 1) res = res * x % mod;
    x = x * x % mod;
    y >>= 1;
  }
  return res;
}
int n, m, k, rt;
int a[333][333];
int main() {
  scanf("%d", &n);
  int cnt = 1;
  for (int i = 1; i <= n / 2; i++)
    for (int j = 1; j <= n; j++) a[j][i] = cnt++;
  for (int i = n / 2 + 1; i <= n; i++)
    for (int j = n; j >= 1; j--) a[j][i] = cnt++;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) printf("%d ", a[i][j]);
    puts("");
  }
  return 0;
}
