#include <bits/stdc++.h>
using namespace std;
long long mod = 1000000007;
long long expow(long long a, long long b) {
  if (b == 1) return 1;
  long long res = expow(a, b / 2) % mod;
  if (b % 2 == 1)
    return (a * res * res) % mod;
  else
    return (res * res) % mod;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  long long n;
  cin >> n;
  long long ar[n][n];
  long long counter = 1, kolom = 0;
  ;
  for (long long i = 0; i < n; i++) {
    if (kolom % 2 == 0)
      for (long long j = 0; j < n; j++) {
        ar[j][i] = counter++;
      }
    else
      for (long long j = 0; j < n; j++) {
        ar[n - 1 - j][i] = counter++;
      }
    kolom++;
  }
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < n; j++) {
      cout << ar[i][j];
      if (j < n - 1)
        cout << " ";
      else
        cout << "\n";
    }
  }
  return 0;
}
