#include <cstdio> #include <algorithm> using namespace std; int N, n; int main() { while(~scanf ("%d", &N)) { n = N*N; for (int i = 0; i < N; i++) { for (int p = 1; p <= N/2; p++) { printf ("%d %d ", i*(N/2)+p, n-(i*(N/2)+p)+1); } printf ("\n"); } } return 0; }