#include <bits/stdc++.h>
using namespace std;
template <class T>
T big(T a, T b) {
  return a > b ? a : b;
}
long long gcd(long long a, long long b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
long long lcm(long long a, long long b) { return (a * b) / gcd(a, b); }
bool mod(long double a, long double b) { return a / b - floor(a / b); }
long long occurs(vector<long long> v, long long n) {
  auto it = lower_bound(((v)).begin(), ((v)).end(), (n));
  auto it1 = upper_bound(((v)).begin(), ((v)).end(), (n));
  long long x = it1 - it;
  return x;
}
long long logb(long long base, long long x) { return (log(x) / log(base)); }
long long pow(long long n, long long m) {
  long long ans = 1;
  for (long long i{0}; i < m; i++) {
    ans *= n;
  }
  return ans;
}
long long factors(long long ans) {
  long long count = 0;
  for (long long i = 1; i <= sqrt(ans); i++) {
    if (ans % i == 0) {
      if (ans / i == i)
        count++;
      else
        count += 2;
    }
  }
  return count;
}
bool isSubSequence(string str1, string str2, long long m, long long n) {
  if (m == 0) return true;
  if (n == 0) return false;
  if (str1[m - 1] == str2[n - 1])
    return isSubSequence(str1, str2, m - 1, n - 1);
  return isSubSequence(str1, str2, m, n - 1);
}
long long fact(long long n) {
  if (n == 0 || n == 1)
    return 1;
  else
    return n * fact(n - 1);
}
long long f(long long n, long long dp[]) {
  if (dp[n] != 0) return dp[n];
  long long h1 = f(n - 1, dp);
  long long h2 = f(n - 3, dp);
  long long h3 = f(n - 4, dp);
  dp[n] = h1 + h2 + h3;
  return dp[n];
}
long long xnor(long long a, long long b) {
  if (a < b) swap(a, b);
  if (a == 0 && b == 0) return 1;
  long long a_rem = 0;
  long long b_rem = 0;
  long long count = 0;
  long long xnornum = 0;
  while (a) {
    a_rem = a & 1;
    b_rem = b & 1;
    if (a_rem == b_rem) xnornum |= (1 << count);
    count++;
    a = a >> 1;
    b = b >> 1;
  }
  return xnornum;
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  long long a[n][n];
  long long k = 1;
  for (long long i{0}; i < n; i++) {
    if (i % 2 == 0) {
      for (long long j{0}; j < n; j++) {
        a[j][i] = k;
        k++;
      }
    } else {
      for (long long j = n - 1; j >= 0; j--) {
        a[j][i] = k;
        k++;
      }
    }
  }
  for (long long i{0}; i < n; i++) {
    for (long long j{0}; j < n; j++) {
      cout << a[i][j] << " ";
    }
    cout << endl;
  }
  return 0;
}
