#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
long long power(long long a, long long b) {
  a = a % mod;
  long long ans = 1;
  while (b > 0) {
    if (b % 2 == 1) {
      ans = (ans * a) % mod;
    }
    b = b / 2;
    a = (a * a) % mod;
  }
  return ans;
}
long long nCrModp(long long n, long long r, long long p) {
  long long C[r + 1];
  memset(C, 0, sizeof(C));
  C[0] = 1;
  for (long long i = 1; i <= n; i++) {
    for (long long j = min(i, r); j > 0; j--) C[j] = (C[j] + C[j - 1]) % p;
  }
  return C[r];
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n;
  cin >> n;
  long long ans[n][n];
  long long k = 1;
  long long j = 0;
  while (k <= n * n) {
    for (long long i = 0; i < n; i++) {
      ans[i][j] = k;
      k++;
    }
    j++;
    if (k > n * n) {
      break;
    }
    for (long long i = n - 1; i >= 0; i--) {
      ans[i][j] = k;
      k++;
    }
    j++;
  }
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < n; j++) {
      cout << ans[i][j] << " ";
    }
    cout << endl;
  }
}
