#include <bits/stdc++.h>
using namespace std;
long long n, m, k, i, c, b, energy, ans, s, j, a[540000], us[540000];
bool cmp(long long a, long long b) { return (a > b); }
int main() {
  cin >> n;
  c = n * n;
  k = 1;
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= n / 2; j++) {
      cout << k << " " << c << " ";
      c--;
      k++;
    }
    cout << '\n';
  }
  return 0;
}
