#include <bits/stdc++.h>
using namespace std;
int a[305][305];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  int id = 1;
  for (int i = 1; i <= n; i++) {
    if (i % 2 == 1)
      for (int j = 1; j <= n; j++) {
        a[j][i] = id;
        id++;
      }
    else
      for (int j = n; j >= 1; j--) {
        a[j][i] = id;
        id++;
      }
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) cout << a[i][j] << ' ';
    cout << '\n';
  }
  return 0;
}
