#include using namespace std; using ll = long long; using Graph = vector>; long long primeNumber(long long x) { bool fire = true; for(int i = 2; i <= sqrt(x); i++) { if(x % i == 0) { fire = false; } } return fire; } int main() { long long N; cin >> N; for(int i = 0; i < N; i++) { for(int j = 0; j < N; j++) { if((i + j) % N == 0) { cout << N << " "; }else { cout << (i + j) % N << " "; } } cout <