import std.algorithm, std.conv, std.range, std.stdio, std.string; import std.math; // math functions void main() { auto rd = readln.split.to!(long[]), x = rd[0], y = rd[1], z = rd[2]; writeln(calc(x, y, z)); } auto calc(long x, long y, long z) { if (z == 0) return "ccW"; if (x == 0 && y == 0) return "NO"; if (x == 0) { if (z % y) return "NO"; auto g = z/y; return 'w'.repeat.take(g).chain('C'.repeat.take(g-1)).to!string; } if (y == 0) { if (z % x) return "NO"; auto g = z/x; return 'c'.repeat.take(g).chain('C'.repeat.take(g-1)).to!string; } foreach (a; -5000L..5001L) { writeln([x, y, z, a]); if ((z-a*x)%y) continue; auto b = (z-a*x)/y; if (a*2+b*2-1 > 10000) continue; if (a == 0) return 'w'.repeat.take(b).chain('C'.repeat.take(b-1)).to!string; if (b == 0) return 'c'.repeat.take(a).chain('C'.repeat.take(a-1)).to!string; if (a < 0) return 'w'.repeat.take(b).chain('C'.repeat.take(b-1)) .chain('c'.repeat.take(-a)).chain('W'.repeat.take(-a)).to!string; if (b < 0) return 'c'.repeat.take(a).chain('C'.repeat.take(a-1)) .chain('w'.repeat.take(-b)).chain('W'.repeat.take(-b)).to!string; return 'c'.repeat.take(a).chain('C'.repeat.take(a-1)) .chain('w'.repeat.take(b)).chain('C'.repeat.take(b)).to!string; } return "NO"; }