#include <bits/stdc++.h>
using namespace std;
const double PI = 2.0 * acos(0.0);
const int MOD = 1e9 + 7;
const long long oo = 1e9 + 7;
long long GCD(long long a, long long b) { return !b ? a : GCD(b, a % b); }
int grid[333][333];
int main() {
  int n;
  cin >> n;
  int val = 1;
  bool f = 1;
  for (long long i = 0; i < n; i++) {
    if (f)
      for (long long j = 0; j < n; j++) grid[j][i] = val++;
    else {
      for (int j = n - 1; j > -1; j--) grid[j][i] = val++;
    }
    f = !f;
  }
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < n; j++) cout << grid[i][j] << " ";
    cout << '\n';
  }
  return 0;
}
