cin >> n; ll mul = 1; vector<int> ans; for (int i = 1; i < n; ++i) if (gcd(i, n) == 1) mul = mul * i % n; if (mul == 1) { for (int i = 1; i < n; ++i) if (gcd(i, n) == 1) ans.push_back(i); cout << ans.size() << "\n"; for (auto u : ans) cout << u << " "; } else { for (int i = 1; i < n - 1; ++i) if (gcd(i, n) == 1) ans.push_back(i); cout << ans.size() << "\n"; for (auto u : ans) cout << u << " "; } return0; }