#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const int N = 305;
const int INF = 1e9;
vector<int> ans[N];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, cnt = 1, i = 1;
  cin >> n;
  while (i <= n) {
    if (i & 1)
      for (int j = 0; j < n; j++) ans[j].push_back(cnt++);
    else
      for (int j = n - 1; j >= 0; j--) ans[j].push_back(cnt++);
    ++i;
  }
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < n; ++j) {
      cout << ans[i][j];
      if (j < n - 1) cout << " ";
    }
    cout << "\n";
  }
}
