#include <bits/stdc++.h>
const long long INF = LLONG_MAX;
const long long MOD = 1e9 + 7;
using namespace std;
void fastio() {}
void solve() {
  long long n;
  cin >> n;
  long long arr[n][n];
  long long count = n * n;
  for (long long i = 0; i < n; i++) {
    if (i % 2 == 0) {
      for (long long j = 0; j < n; j++) {
        arr[j][i] = count;
        count--;
      }
    } else {
      for (long long j = n - 1; j >= 0; j--) {
        arr[j][i] = count;
        count--;
      }
    }
  }
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < n; j++) {
      cout << arr[i][j] << ' ';
    }
    cout << endl;
  }
  return;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long t;
  t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
