#include <bits/stdc++.h>
using namespace std;
const int INF = (int)1E9;
const double INFD = 1E9;
const long long INFLL = (long long)1E15;
const long long MOD = (long long)1E9 + 7;
const long double PI = acos(-1);
const long double EPS = 1E-9;
bool between(int x, int l, int r) { return (l <= x && x <= r); }
string tostring(int x) {
  char dum[20];
  sprintf(dum, "%d", x);
  string ret(dum);
  return ret;
}
inline void work(int kasus) {}
int n;
int main() {
  cin >> n;
  for (int i = 0; i < n; i += 1) {
    for (int j = 0; j < n; j += 1) {
      if (j != 0) cout << " ";
      cout << j * n + (i + j) % n + 1;
    }
    cout << endl;
  }
  return 0;
}
