#include #include #include #define repeat(i,n) for (int i = 0; (i) < (n); ++(i)) #define repeat_from(i,m,n) for (int i = (m); (i) < (n); ++(i)) typedef long long ll; using namespace std; string solve(ll x, ll y, ll z) { const int limit = 10000; for (int b = -limit/2; b <= limit/2; ++ b) { int a = (z - y*b) / x; if (a*x + y*b == z) { deque s; if (a > 0) { s.push_back('c'); -- a; } else if (b > 0) { s.push_back('w'); -- b; } else { s.push_back('c'); s.push_back('c'); s.push_back('W'); } if (s.size() + 2*abs(a) + 2*abs(b) > limit) continue; repeat (i, abs(a)) { s.push_front('c'); s.push_back(a > 0 ? 'C' : 'W'); } repeat (i, abs(b)) { s.push_front('w'); s.push_back(b > 0 ? 'C' : 'W'); } return string(s.begin(), s.end()); } } return ""; } int main() { int x, y, z; cin >> x >> y >> z; int gcd = __gcd(x, y); string ans; if (z % gcd == 0) ans = solve(x / gcd, y / gcd, z / gcd); if (ans.empty()) ans = "mourennaihasimasenn"; cout << ans << endl; return 0; }