#include <bits/stdc++.h>
using namespace std;
int dx[] = {1, -1, 0, 0};
int dy[] = {0, 0, 1, -1};
int dx8[] = {1, -1, 0, 0, 1, 1, -1, -1};
int dy8[] = {0, 0, 1, -1, 1, -1, 1, -1};
bool isvowel(char c) {
  switch (c) {
    case 'a':
    case 'e':
    case 'i':
    case 'o':
    case 'u':
      return true;
    default:
      return false;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t;
  t = 1;
  while (t--) {
    long long n;
    cin >> n;
    long long a[n][n], i = 0, j = 0, c = 1;
    while (1) {
      a[i++ % n][j] = c;
      if (c % n == 0) {
        i--;
        j++;
      }
      c++;
      if (c == n * n + 1) break;
    }
    for (i = 0; i < n; i++) {
      for (j = 0; j < n; j++) {
        cout << a[i][j] << " ";
      }
      cout << "\n";
    }
  }
  return 0;
}
