#include using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(0); int N; cin >> N; for (int i = 0; i < N; ++i) { for (int j = 0; j < N; ++j) { cout << (i + j) % N + 1 << ' '; } cout << endl; } }