#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e6 + 10;
const long long inf = 1e15;
const int mod = 1e6;
void faster() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
}
const long long N = 3000 * 200;
int mark[N];
int main() {
  faster();
  int n;
  cin >> n;
  int t = 0;
  vector<int> v[n];
  for (int i = 1; i <= n * n; i++) {
    v[(i + t) % n].push_back(i);
    if (i % n == 0) t++;
  }
  for (int i = 0; i < n; i++) {
    for (auto c : v[i]) cout << c << " ";
    cout << endl;
  }
}
