#include <bits/stdc++.h>
using namespace std;
long long tc = 1;
int main() {
  ios::sync_with_stdio(0);
  ;
  long long n;
  cin >> n;
  long long type = 0, val = 1;
  map<long long, vector<long long>> mp;
  for (int i = 1; i <= n; i++) {
    if (!type) {
      for (int j = 1; j <= n; j++) mp[j].push_back(val++);
    } else {
      for (int j = n; j >= 1; j--) mp[j].push_back(val++);
    }
    type ^= 1;
  }
  for (auto it : mp) {
    for (auto x : it.second) cout << x << " ";
    cout << "\n";
  }
  return 0;
}
