#include #define rep(i,n) for(int i=0;i> x >> y >> z; for (int a=-3500; a<=3500; a++) { for (int b=-3500; b<=3500; 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; } if (a_len + b_len + 1 <= 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'; cout << 'C' << endl; return 0; } } } } cout << "mourennaihasimasenn" << endl; }