#include <bits/stdc++.h>
using namespace std;
vector<long long int> v;
set<long long int> s1;
set<long long int> s2;
set<string> st2;
vector<long long int> v1;
vector<long long int> v2;
vector<long long int> v3;
vector<long long int> v4;
vector<long long int> v5;
vector<pair<long long int, long long int> > v6;
vector<string> v7;
vector<string> v8;
vector<char> v9;
vector<double> v11;
list<long long int> l;
int main() {
  long long int n, c = 0, d = 1;
  cin >> n;
  c = pow(n, 2);
  int a[n][n];
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (j % 2 == 0) {
        a[i][j] = c;
        c--;
      } else {
        a[i][j] = d;
        d++;
      }
      cout << a[i][j] << " ";
    }
    cout << endl;
  }
}
