#include <bits/stdc++.h>
using namespace std;
long long e[1005][1005];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  long long n;
  cin >> n;
  long long cnt = 0;
  for (int i = 1; i <= n; i++) {
    if (i % 2 == 1)
      for (int j = 1; j <= n; j++) {
        cnt++;
        e[j][i] = cnt;
      }
    else
      for (int j = n; j >= 1; j--) {
        cnt++;
        e[j][i] = cnt;
      }
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      cout << e[i][j] << " ";
    }
    cout << "\n";
  }
  return 0;
}
