#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  int n;
  cin >> n;
  vector<int> a;
  int temp;
  for (int j = 1; j <= n; j++) {
    a.clear();
    temp = j;
    for (int i = 0; i < n * n; i += n) {
      a.push_back(i + temp);
      temp++;
      if (temp > n) temp = 1;
    }
    for (int i = 0; i < a.size(); i++) cout << a[i] << " ";
    cout << endl;
  }
  return 0;
}
