#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; using ll = long long; #define rep(i,n) for(int i = 0; i < (int)(n); ++i) ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; } ll extgcd(ll a, ll b, ll c, ll& x, ll& y) { ll g = a; x = c / a; y = 0; if (b) g = extgcd(b, a%b, c%b, y, x), y += (c / b) - (a / b) * x; return g; } ll simulate(string s, ll x, ll y) { stack st; for (char c : s) { ll a = 0; switch (c) { case 'c': st.push(x); break; case 'w': st.push(y); break; case 'C': a += st.top(); st.pop(); a += st.top(); st.pop(); st.push(a); break; case 'W': a += st.top(); st.pop(); a -= st.top(); st.pop(); st.push(a); break; default: break; } } return st.top(); } const string muri = "mourennaihasimasenn"; string solve(ll x, ll y, ll z) { //if (x < y) swap(x, y); if (z % gcd(x, y) != 0) { return "mourennaihasimasenn"; } // xc + yw = z ll c, w; extgcd(x, y, z, c, w); //cerr << c << ' ' << w << endl; if (abs(x) + abs(y) > 10000) { return "mourennaihasimasenn"; } string sub; if (c < 0) sub += string(-c, 'c'); if (w < 0) sub += string(-w, 'w'); string add; if (c > 0) add += string(c, 'c'); if (w > 0) add += string(w, 'w'); if (sub.size() == 0 && add.size() == 0){ return "ccW"; } if (sub.size() == 0 && add.size() == 1) { return add + add + add + "CW"; } if (sub.size() == 0 && add.size() > 1) { if (add.size() * 2 - 1 > 10000) return muri; return add + string(add.size() - 1, 'C'); } if (sub.size() == 1 && add.size() == 0) { assert(false); } if (sub.size() == 1 && add.size() == 1) { return sub + add + "W"; } if (sub.size() == 1 && add.size() > 1) { if (1 + add.size() * 2 - 1 + 1 > 10000) return muri; return sub + add + string(add.size() - 1, 'C') + "W"; } if (sub.size() > 1 && add.size() == 0) { assert(false); } if (sub.size() > 1 && add.size() == 1) { if (sub.size() * 2 - 1 + 1 + 1 > 10000) return muri; return sub + string(sub.size() - 1, 'C') + add + "W"; } if (sub.size() > 1 && add.size() > 1) { if (sub.size() * 2 - 1 + add.size() * 2 - 1 + 1 > 10000) return muri; return sub + string(sub.size() - 1, 'C') + add + string(add.size() - 1, 'C') + "W"; } assert(false); } int main() { ll x, y, z; while (cin >> x >> y >> z) { cout << solve(x, y, z) << endl; } }