#include "bits/stdc++.h" using namespace std; #define FOR(i,j,k) for(int (i)=(j);(i)<(int)(k);++(i)) #define rep(i,j) FOR(i,0,j) #define each(x,y) for(auto &(x):(y)) #define mp make_pair #define all(x) (x).begin(),(x).end() #define debug(x) cout<<#x<<": "<<(x)< pii; typedef vector vi; typedef vector vll; vector exgcd(long long a, long long b){ if(b==0) return vector{1, 0, a}; auto res = exgcd(b, a%b); return vector{res[1], res[0]-a/b*res[1], res[2]}; } char NG[] = "mourennaihasimasenn"; const int LIM = 10000, MA = 100000000; int main(){ ll x, y, z; cin >> x >> y >> z; // if(x > y)swap(y, x); // x<=y /* if(x == 0 && y == 0) { if(z == 0) { puts("c"); } else { puts(NG); } } else if(x == 0 || y == 0) { if(z == 0) { puts("c"); } else if(z%y ) { if(z == y) { puts("w"); } else if(y / z * 2 - 1 <= LIM) { int num = y / z; string ans = string(num, 'w')+ } else { puts(NG); } } else { puts(NG); } } else { }*/ if(x == 0 && y == 0) { if(z == 0) { puts("c"); } else { puts(NG); } return 0; } if(z == 0) { if(x == 0) { puts("c"); return 0; } if(y == 0) { puts("w"); return 0; } } // xだけ for(int a = 1; a <= LIM; ++a){ ll val = a*x; int len = a + (a > 1 ? a - 1 : 0); if(val == z && len <= LIM) { string ans = string(a, 'c'); if(a > 1)ans += string(a - 1, 'C'); printf("%s\n", ans.c_str()); return 0; } } // yだけ for(int a = 1; a <= LIM; ++a){ ll val = a*y; int len = a + (a > 1 ? a - 1 : 0); if(val == z && len <= LIM) { string ans = string(a, 'w'); if(a > 1)ans += string(a - 1, 'C'); printf("%s\n", ans.c_str()); return 0; } } if(x == 0 || y == 0) { puts(NG); return 0; } string ans; // x!=0 && y != 0 for(int a = -LIM; a <= LIM; ++a) if(a){ ll need = z - a*x; // need != 0 if(need%y == 0) { ll b = need / y; ll cost = abs(a) + abs(b) + (abs(a) + abs(b) - 1); if(cost > LIM)continue; if(a > 0 && b > 0) { ans = string(a, 'c') + string(b, 'w') + string(a + b - 1, 'C'); printf("%s\n", ans.c_str()); } else if(a > 0 && b < 0) { b = abs(b); ans = string(b, 'w') + string(b - 1, 'C') + string(a, 'c') + string(a-1, 'C') + string(1,'W'); } else { // a < 0 && b > 0 a = abs(a); ans = string(a, 'c') + string(a - 1, 'C') + string(b, 'w') + string(b-1, 'C') + string(1,'W'); } printf("%s\n", ans.c_str()); return 0; } } puts(NG); }