#include <bits/stdc++.h>
using namespace std;
bool sortbysec(const pair<int, int> &a, const pair<int, int> &b) {
  return (a.second < b.second);
}
long long n, i, j, c, a, x, y, s;
vector<long long> v[302];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n;
  for (i = 2; i <= n; i += 2) {
    for (j = 1; j <= n; j++) {
      s = i * n;
      x = (i - 2) * n + j;
      y = (i - 2) * n + s - x + 1;
      v[j].push_back(x);
      v[j].push_back(y);
      if (n % 2 && i == n - 1) {
        v[j].push_back(i * n + j);
      }
    }
  }
  for (i = 1; i <= n; i++) {
    for (j = 0; j < n; j++) {
      cout << v[i][j];
      if (j == n - 1)
        cout << "\n";
      else
        cout << " ";
    }
  }
  return 0;
}
