#include <bits/stdc++.h>
using namespace std;
int n, a[301][301];
void sol() {
  int num = 1;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= n; j++) a[j][i] = num++;
  for (int i = 1; i * 2 <= n; i++)
    for (int j = 2; j <= n; j += 2) swap(a[i][j], a[n - i + 1][j]);
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      cout << a[i][j];
      if (j != n) cout << " ";
    }
    if (i != n) cout << endl;
  }
}
int main() {
  cin >> n;
  sol();
  return 0;
}
