#include <bits/stdc++.h>
using namespace std;
void dpm(map<long long int, long long int> m1) {
  for (auto it = m1.begin(); it != m1.end(); it++) {
    cout << it->first << " " << it->second << '\n';
  }
  cout << '\n';
}
void dpv(vector<long long int> v) {
  for (long long int i = 0; i < v.size(); i++) cout << v[i] << " ";
  cout << '\n';
}
void dps(set<long long int> s1) {
  for (auto it = s1.begin(); it != s1.end(); it++) cout << *it << " ";
  cout << '\n';
}
void dpa(long long int arr[], long long int n) {
  for (long long int i = 0; i < n; i++) cout << arr[i] << " ";
  cout << '\n';
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  long long int i, j;
  long long int t = 1;
  while (t--) {
    long long int n;
    cin >> n;
    long long int arr[n + 1][n + 1];
    i = 1;
    long long int temp = 1;
    for (i = 1; i <= n; i++) {
      j = 1;
      if (i % 2 != 0) {
        for (j = 1; j <= n; j++) {
          arr[j][i] = temp;
          temp++;
        }
      } else {
        for (j = n; j >= 1; j--) {
          arr[j][i] = temp;
          temp++;
        }
      }
    }
    for (i = 1; i <= n; i++) {
      for (j = 1; j <= n; j++) cout << arr[i][j] << " ";
      cout << '\n';
    }
  }
}
