#include using namespace std; typedef long long ll; ll extgcd(ll a, ll b, ll &x, ll &y){ ll g = a; x = 1, y = 0; if(b != 0){ g = extgcd(b, a%b, y, x); y -= (a / b) * x; } return g; } void answer(ll a, ll b){ int add = 0, sub = 0; if(a < 0){ for(int i = 0; i < abs(a); i++) cout << "c"; sub += (int)abs(a); } if(b < 0){ for(int i = 0; i < abs(b); i++) cout << "w"; sub += (int)abs(b); } if(a > 0){ for(int i = 0; i < abs(a); i++) cout << "c"; add += (int)abs(a)-1; } if(b > 0){ for(int i = 0; i < abs(b); i++) cout << "w"; add += (int)abs(b)-1; } while(add-- > 0) cout << "C"; while(sub-- > 0) cout << "W"; cout << endl; } int main(){ int x, y, z; cin >> x >> y >> z; ll a, b; ll g = extgcd(x, y, a, b); if(z % g){ cout << "NO" << endl; return 0; } a *= z/g, b *= z/g; // x*a + y*b = z ll alpha = a, beta = b, current = 1ll<<60; while(current >= abs(alpha) + abs(beta)){ current = abs(alpha) + abs(beta); if((abs(alpha)+abs(beta))*2 - 1 <= 10000){ answer(alpha, beta); return 0; } alpha -= y; beta += x; } alpha = a, beta = b, current = 1ll<<60; while(current >= abs(alpha) + abs(beta)){ current = abs(alpha) + abs(beta); if((abs(alpha)+abs(beta))*2 - 1 <= 10000){ answer(alpha, beta); return 0; } alpha += y; beta -= x; } cout << "NO" << endl; return 0; }