#include <bits/stdc++.h>
using namespace std;
void Fastio() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
int main() {
  Fastio();
  int n, c = 0, num = 1;
  cin >> n;
  deque<int> arr[n];
  for (int i = 0; i < n; i++) {
    if (!c) {
      for (int y = 0; y < n; y++) {
        arr[y].push_back(num);
        num++;
      }
      c = 1;
    } else {
      for (int y = n - 1; y >= 0; y--) {
        arr[y].push_back(num);
        num++;
      }
      c = 0;
    }
  }
  for (int i = 0; i < n; i++) {
    while (!arr[i].empty()) {
      cout << arr[i].front() << " ";
      arr[i].pop_front();
    }
    cout << '\n';
  }
  return 0;
}
