#include using namespace std; void fast_io() { ios_base::sync_with_stdio(false); cin.tie(nullptr); } int main() { fast_io(); int n; cin >> n; for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { cout << (i + j) % n + 1 << (j + 1 == n ? "\n" : " "); } } }