#include <bits/stdc++.h>
using namespace std;
long long dfs(long long a, long long b, long long c) {
  long long c1 = 0, c2 = 0;
  if (a > 0 && b > 1) {
    c1 = 3 + dfs(a - 1, b - 2, c);
  }
  if (b > 0 && c > 1) {
    c2 = 3 + dfs(a, b - 1, c - 2);
  }
  return max(c1, c2);
}
int main() {
  long long n;
  cin >> n;
  long long arr[n][n];
  long long ct = 1;
  long long i = 0, j = 0;
  long long dir = 0;
  while (ct <= n * n) {
    if (dir == 0) {
      arr[i][j] = ct;
      ct++;
      i++;
    }
    if (dir == 1) {
      arr[i][j] = ct;
      ct++;
      i--;
    }
    if (i == -1) {
      dir = 0;
      j++;
      i++;
    }
    if (i == n) {
      dir = 1;
      i--;
      j++;
    }
  }
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < n; j++) {
      cout << arr[i][j] << " ";
    }
    cout << endl;
  }
  return 0;
}
