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