#include <bits/stdc++.h>
using namespace std;
long long n;
vector<long long> vec[310];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  long long cur = 1;
  while (cur <= n * n) {
    for (long long i = 1; i <= n; i++) vec[i].push_back(cur++);
    if (cur > n * n) break;
    for (long long i = n; i >= 1; i--) vec[i].push_back(cur++);
  }
  for (long long i = 1; i <= n; i++) {
    for (auto x : vec[i]) cout << (long long)x << " ";
    cout << "\n";
  }
}
