#include #define rep(i,n) for(int i=0;i> x >> y >> z; if (x == 0 && y == 0 && z == 0) { cout << "ccW" << endl; return 0; } if (x == 0 && y == 0 && z != 0) { cout << "mourennaihasimasenn" << endl; return 0; } if (y == 0) { if (z % x == 0 && z / x * 2 - 1 <= 10000) { int cnt = z / x; rep(i,cnt) cout << 'c'; rep(i,cnt-1) cout << 'C'; cout << endl; return 0; } else { cout << "mourennaihasimasenn" << endl; return 0; } } if (x == 0) { if (z % y == 0 && z / y * 2 - 1 <= 10000) { int cnt = z / y; rep(i,cnt) cout << 'w'; rep(i,cnt-1) cout << 'C'; cout << endl; return 0; } else { cout << "mourennaihasimasenn" << endl; return 0; } } for (int a=-5000; a<=5000; a++) { if ((z - a * x) % y == 0) { int b = (z - a * x) / y; if (2 * abs(a) + 2 * abs(b) - 1 <= 10000) { //printf("a = %lld, b = %lld\n", a, b); if (a == 0 && b == 0) { cout << "ccW" << endl; return 0; } else if (a * b < 0) { if (a < 0) { rep(i,-a) cout << 'c'; rep(i,-a-1) cout << 'C'; rep(i,b) cout << 'w'; rep(i,b-1) cout << 'C'; cout << 'W' << endl; return 0; } else if (b < 0) { rep(i,-b) cout << 'w'; rep(i,-b-1) cout << 'C'; rep(i,a) cout << 'c'; rep(i,a-1) cout << 'C'; cout << 'W' << endl; return 0; } } else { rep(i,a) cout << 'c'; rep(i,a-1) cout << 'C'; rep(i,b) cout << 'w'; rep(i,b-1) cout << 'C'; cout << 'C' << endl; return 0; } } } } cout << "mourennaihasimasenn" << endl; }