#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  int c = 1;
  int arr[n];
  bool t = 0;
  for (int i = 0; i < n; i++) {
    arr[i] = c;
    if (!t)
      c += 2 * n - 1;
    else
      c++;
    t = 1 - t;
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      cout << arr[j] << " ";
      if (j & 1)
        arr[j]--;
      else
        arr[j]++;
    }
    cout << endl;
  }
  return 0;
}
