#include <bits/stdc++.h>
using namespace std;
int gcd(long long int a, long long int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long int binomialCoeff(long long int n, long long int k) {
  long long int C[n + 1][k + 1];
  long long int i, j;
  for (i = 0; i <= n; i++) {
    for (j = 0; j <= min(i, k); j++) {
      if (j == 0 || j == i)
        C[i][j] = 1;
      else
        C[i][j] = ((C[i - 1][j - 1]) % 998244353 + (C[i - 1][j]) % 998244353) %
                  998244353;
    }
  }
  return C[n][k];
}
long long int digsum(long long int a) {
  long long int sum = 0;
  while (a > 0) {
    sum += a % 10;
    a = a / 10;
  }
  return sum;
}
long long int power(long long int x, long long int y, long long int p) {
  long long int res = 1;
  x = x % p;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}
int fact(int a) {
  if (a == 1)
    return a;
  else
    return a * fact(a - 1);
}
int max3(int a, int b, int c) { return max(a, max(b, c)); }
bool palindromecheck(string s) {
  int n = s.length();
  int i = 0, j = n - 1;
  for (; i <= j;) {
    if (s[i] != s[j]) return false;
    i++;
    j--;
  }
  return true;
}
int main() {
  int n;
  cin >> n;
  int arr[n][n];
  int temp = 1;
  for (long long int j = 0; j <= n - 1; j++) {
    if (j % 2 == 0)
      for (long long int i = 0; i <= n - 1; i++) {
        arr[i][j] = temp;
        temp++;
      }
    else
      for (int i = n - 1; i >= 0; i--) {
        arr[i][j] = temp;
        temp++;
      }
  }
  for (long long int i = 0; i <= n - 1; i++) {
    for (long long int j = 0; j <= n - 1; j++) cout << arr[i][j] << " ";
    cout << endl;
  }
  return 0;
}
