#include <bits/stdc++.h>
using namespace std;
long long int tree[5 * 300006];
long long int lazy[5 * 300006];
long long int n;
long long int arr[300006];
bool vis[300006];
map<long long int, long long int> m;
vector<long long int> v, vv;
long long int p = 1000000007;
long long int power(long long int x, long long int y) {
  long long int res = 1;
  x = x % p;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}
long long int a[1000][1000];
int main() {
  long long int n, m;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    a[i][1] = i;
  }
  long long int cnt = n + 1;
  for (int j = 2; j <= n; j++) {
    if (j & 1) {
      for (int i = 1; i <= n; i++) {
        a[i][j] = cnt++;
      }
    } else {
      for (int i = n; i >= 1; i--) a[i][j] = cnt++;
    }
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      cout << a[i][j] << " ";
    }
    cout << endl;
  }
}
