#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n, x;
  cin >> n;
  int a[n][n];
  x = 1;
  for (int i = 0; i < n; i++) {
    for (int j = i; j < n; j++) {
      a[i][j] = x;
      x++;
    }
    for (int j = 0; j < i; j++) {
      a[i][j] = x;
      x++;
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      cout << a[j][i] << " ";
    }
    cout << endl;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  solve();
  return 0;
}
