#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  cin >> n;
  std::vector<int> v[n];
  int bag = 0;
  int flag = 1;
  for (int i = (1); i < (n * n + 1); i++) {
    v[bag].push_back(i);
    if (flag) bag++;
    if (!flag) bag--;
    if (bag == n) {
      flag = 0;
      bag = n - 1;
    }
    if (bag == -1) {
      flag = 1;
      bag = 0;
    }
  }
  for (int i = (0); i < (n); i++) {
    for (int j = (0); j < (v[i].size()); j++) {
      cout << v[i][j] << " ";
    }
    cout << "\n";
  }
  return 0;
}
