#include <bits/stdc++.h>
using namespace std;
int n;
const int MD = 1e9 + 7;
int a[309][309];
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  int cur = 1;
  for (int j = 0; j < n;) {
    for (int i = 0; i < n; i++) {
      a[i][j] = cur;
      cur++;
    }
    j++;
    for (int i = n - 1; i >= 0; i--) {
      a[i][j] = cur;
      cur++;
    }
    j++;
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      cout << a[i][j] << " ";
    }
    cout << endl;
  }
  return 0;
}
