#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  cin >> n;
  vector<vector<int>> v(n, vector<int>(n));
  int k = -n, flag = 0, prev;
  for (int j = 0; j < n; j++) {
    if (!flag) {
      k = k + n;
      for (int i = 0; i < n; i++) v[i][j] = ++k;
    } else {
      k = k + n;
      for (int i = 0; i < n; i++) v[i][j] = k--;
    }
    flag = !flag;
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) cout << v[i][j] << " ";
    cout << endl;
  }
  return 0;
}
