#include <bits/stdc++.h>
using namespace std;
inline void setPrecision(int n) { cout.precision(n); }
long long int INF = 1e10;
int MOD = 1e9 + 7;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  int a[n][n];
  int cnt = 1;
  for (int i = 0; i < n; ++i)
    if (i % 2 == 0)
      for (int j = 0; j < n; ++j) a[j][i] = cnt++;
    else
      for (int j = n - 1; j >= 0; --j) a[j][i] = cnt++;
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < n; ++j) cout << a[i][j] << " ";
    cout << "\n";
  }
  return 0;
}
