#include <bits/stdc++.h>
using namespace std;
int min(int x, int y) {
  if (x > y) {
    return y;
  } else {
    return x;
  }
}
int max(int x, int y) {
  if (x < y) {
    return y;
  } else {
    return x;
  }
}
int gcd(int a, int b) {
  if (a == 0) return b;
  if (b == 0) return a;
  if (a == b) return a;
  if (a > b) return gcd(a - b, b);
  return gcd(a, b - a);
}
int main() {
  int n, i, j;
  cin >> n;
  int** arr = new int*[n];
  for (i = 0; i < n; ++i) arr[i] = new int[n];
  for (i = 0; i < n; i++) {
    for (j = 0; j < n; j++) {
      if (i < n / 2) {
        arr[j][i] = n * i + j + 1;
      } else {
        arr[j][i] = n * i + n - j;
      }
    }
  }
  for (i = 0; i < n; i++) {
    for (j = 0; j < n; j++) {
      cout << arr[i][j] << " ";
    }
    cout << "\n";
  }
  return 0;
}
