#include <bits/stdc++.h>
using namespace std;
bool isPrime(long long n) {
  if (n <= 1) return false;
  for (long long i = 2; i < n; i++)
    if (n % i == 0) return false;
  return true;
}
long long SieveOfEratosthenes(long long n, long long a) {
  bool prime[n + 1];
  memset(prime, true, sizeof(prime));
  for (long long p = 2; p * p <= n; p++) {
    if (prime[p] == true) {
      for (long long i = p * p; i <= n; i += p) prime[i] = false;
    }
  }
  for (long long p = 2; p <= n; p++)
    if (prime[p]) {
      if (a % p == 0) {
        return (a - p);
      }
    }
}
long long nCr(int n, int r) {
  if (r > n - r) r = n - r;
  long long ans = 1;
  int i;
  for (i = 1; i <= r; i++) {
    ans *= n - r + i;
    ans /= i;
  }
  return ans;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long a, b, c, d, e, g, h, n, t, f, k, l, m,
      f1 = 0, flag = 0, flag1 = 0, co = 0, co1 = 0, co2 = 0, arr[100001],
      arr1[100001] = {0}, sum = 0, sum1 = 0, ma = 0, ma1 = 0,
      mi = 1000000000000000001;
  long long co3 = 0, co4 = 0, co5 = 0, co6 = 0, co7 = 0, co8 = 0, mul = 1;
  double pi = 2 * acos(0.0);
  string str, str1, str2, str3;
  char ch, ch1;
  vector<long long> v;
  vector<long long> v1;
  vector<string> vs;
  vector<string> vs1;
  map<char, long long> mp;
  map<char, int> mp1;
  set<long long> s;
  set<long long> s1;
  list<long long> li;
  list<long long>::iterator it;
  queue<long long> q;
  vector<pair<long long, long long> > v3;
  int x[] = {1, 1, 1, 0, 0, -1, -1, -1};
  int y[] = {0, 1, -1, 1, -1, 1, -1, 0};
  cin >> n;
  v.push_back(1);
  a = 2;
  while (1) {
    if ((n * a) <= (n * n)) {
      v.push_back(n * a);
      if (((n * a) + 1) <= (n * n)) {
        v.push_back((n * a) + 1);
      } else
        break;
    } else
      break;
    a += 2;
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      cout << v[j] << " ";
      if (j == 0 || j % 2 == 0) {
        v[j] += 1;
      } else
        v[j] -= 1;
    }
    cout << endl;
  }
  return 0;
}
