#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int ans[105][105];
  scanf("%d", &n);
  int num = 1;
  for (int j = 1; j <= n; j++) {
    int k = j - 1;
    for (int p = n - k + 1; p <= n; p++) {
      ans[p][j] = num;
      num++;
    }
    for (int p = 1; p <= n - k; p++) {
      ans[p][j] = num;
      num++;
    }
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      cout << ans[i][j] << " ";
    }
    cout << endl;
  }
  return 0;
}
