#include #define rep(i,n) for(int i=0;i> x >> y >> z; for (int a=-4000; a<=4000; a++) { for (int b=-4000; b<=4000; b++) { if (a * x + b * y == z) { int a_len = 0; int w_num1 = 0; int c_num1 = 0; int W_num1 = 0; int C_num1 = 0; if (a < 0) { int abs_a = abs(a); c_num1 = abs_a + 2; W_num1 = abs_a + 1; a_len = c_num1 + W_num1; } else if (a > 0) { c_num1 = a; C_num1 = a - 1; a_len = c_num1 + C_num1; } int w_num2 = 0; int c_num2 = 0; int W_num2 = 0; int C_num2 = 0; int b_len = 0; if (b < 0) { int abs_b = abs(b); w_num2 = abs_b + 2; W_num2 = abs_b + 1; b_len = w_num2 + W_num2; } else if (b > 0) { w_num2 = b; C_num2 = b - 1; b_len = w_num2 + C_num2; } int add; if (a == 0 || b == 0) { add = 0; } else { add = 1; } if (a_len + b_len + add <= 10000) { rep(i,c_num1) cout << 'c'; rep(i,W_num1) cout << 'W'; rep(i,C_num1) cout << 'C'; rep(i,w_num2) cout << 'w'; rep(i,W_num2) cout << 'W'; rep(i,C_num2) cout << 'C'; if (a == 0 || b == 0) { ; } else { cout << 'C' << endl; } return 0; } } } } cout << "mourennaihasimasenn" << endl; }