#include using namespace std; using ll = long long; #define rep(i,m,n) for(int i=m; i> N; rep(i, 0, N){ rep(j, 0, N){ cout << (j+i)%N + 1; cout << (j == N-1 ? '\n' : ' '); } } return 0; }