#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  int n;
  cin >> n;
  vector<int> ans[n];
  int j = 0;
  int dir = 1;
  for (int i = 1; i <= n * n; i++) {
    ans[j].push_back(i);
    j += dir;
    if (j == -1 || j == n) dir *= -1, j += dir;
  }
  for (int i = 0; i < n; i++) {
    for (int x : ans[i]) {
      cout << x << " ";
    }
    cout << "\n";
  }
}
