#include <bits/stdc++.h>
using namespace std;
long long int power(long long int a, long long int b, long long int m) {
  long long int ans = 1;
  while (b) {
    if (b & 1) ans = (ans * a) % m;
    b /= 2;
    a = (a * a) % m;
  }
  return ans;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int n;
  cin >> n;
  vector<long long int> ans[n];
  for (long long int i = 0; i < n * n; i++) {
    long long int haha = i % n;
    long long int hihi = i / n;
    if (hihi % 2 == 0)
      ans[haha].push_back(i + 1);
    else
      ans[n - 1 - haha].push_back(i + 1);
  }
  for (long long int i = 0; i < n; i++) {
    for (long long int j = 0; j < ans[i].size(); j++) cout << ans[i][j] << " ";
    cout << endl;
  }
  cout << endl;
}
