#include <bits/stdc++.h>
using namespace std;
const int N = 600010;
const int INF = 0x3f3f3f3f;
const int MOD = 1e9 + 7, STA = 8000010;
const double EPS = 1e-8;
const double OO = 1e15;
const int dx[4] = {-1, 0, 1, 0};
const int dy[4] = {0, 1, 0, -1};
const int day[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
inline int sign(double x) { return (x > EPS) - (x < -EPS); }
template <class T>
T gcd(T a, T b) {
  return b ? gcd(b, a % b) : a;
}
template <class T>
T lcm(T a, T b) {
  return a / gcd(a, b) * b;
}
template <class T>
inline T lcm(T a, T b, T d) {
  return a / d * b;
}
template <class T>
inline T Min(T a, T b) {
  return a < b ? a : b;
}
template <class T>
inline T Max(T a, T b) {
  return a > b ? a : b;
}
template <class T>
inline T Min(T a, T b, T c) {
  return min(min(a, b), c);
}
template <class T>
inline T Max(T a, T b, T c) {
  return max(max(a, b), c);
}
template <class T>
inline T Min(T a, T b, T c, T d) {
  return min(min(a, b), min(c, d));
}
template <class T>
inline T Max(T a, T b, T c, T d) {
  return max(max(a, b), max(c, d));
}
int main() {
  int n, sum;
  while (~scanf("%d", &n)) {
    for (int i = 1; i <= n * n / 2; i++) printf("%d %d\n", i, n * n - i + 1);
  }
  return 0;
}
