// yukicoder: No.438 Cwwプログラミング入門 // 2019.6.27 bal4u #include typedef long long ll; #if 1 #define gc() getchar_unlocked() #define pc(c) putchar_unlocked(c) #else #define gc() getchar() #define pc(c) putchar(c) #endif int in() // 非負整数の入力 { int n = 0, c = gc(); do n = 10 * n + (c & 0xf); while ((c = gc()) >= '0'); return n; } #define ABS(x) ((x)>=0?(x):-(x)) void pcs(int n, char c) { while (n--) pc(c); } void outs(char *s) { while (*s) pc(*s++); pc('\n'); } int extended_gcd(int a, int b, int *x, int *y) { int d; if (b == 0) { *x = 1; *y = 0; return a; } d = extended_gcd(b, a%b, y, x); *y -= a / b * (*x); return d; } int x, y, z; int a, b, d; ll X, Y; ll calc(int s) { X = (z/d)*(ll)a - (y/d)*(ll)s; Y = (z/d)*(ll)b + (x/d)*(ll)s; return ABS(X) + ABS(Y); } int findMin(int l, int r) { int m; while (r-l > 1) { m = (l + r) >> 1; if (calc(m) - calc(m-1) < 0) l = m; else r = m; } return l; } int main() { int s; x = in(), y = in(), z = in(); if (x == 0 && y == 0) { if (z == 0) { outs("ccC"); return 0; } goto err; } if (x == 0) { if (z % y == 0 && z / y <= 5000) { pcs(z/y, 'w'), pcs(z/y-1, 'C'), pc('\n'); return 0; } goto err; } if (y == 0 || x == y) { if (z % x == 0 && z / x <= 5000) { pcs(z/x, 'c'), pcs(z/x-1, 'C'), pc('\n'); return 0; } goto err; } if (z == 0) { outs("ccW"); return 0; } d = extended_gcd(x, y, &a, &b); if (z % d) goto err; s = findMin(-100005, 100005); if (calc(s) > 5000) goto err; x = (int)X, y = (int)Y; if (x < 0) { x = -x; pcs(x, 'c'), pcs(y, 'w'); pcs(y-1, 'C'), pcs(x, 'W'); } else if (y < 0) { y = -y; pcs(y, 'w'), pcs(x, 'c'); pcs(x-1, 'C'), pcs(y, 'W'); } else { pcs(x, 'c'), pcs(y, 'w'); pcs(x+y-1, 'C'); } pc('\n'); return 0; err: outs("NO"); return 0; }