#define _USE_MATH_DEFINES #include //cin, cout #include //vector #include //sort,min,max,count #include //string,getline, to_string #include //abs(int) #include //swap, pair #include //deque #include //INT_MAX #include //bitset #include //sqrt, ceil. M_PI, pow, sin #include //fixed #include //setprecision #include //stringstream #include //gcd, assumlate #include //randam_device #include //numeric_limits using namespace std; constexpr long long int D_MOD = 1000000007; inline unsigned int BinToUInt(const string S) { //2進数(文字列)を10進数(unsigned int)に変換する unsigned int result = 0; for (unsigned int i = 0; i < S.length(); i++) { switch (S[i]) { case '0':result *= 2; break; case '1':result = result * 2 + 1; break; } } return result; } inline string UIntToBin(unsigned int a) { //10進数(unsigned int)を2進数(文字列)に変換する if (a == 0) { return "0"; } string str; while (a != 0) { if (a % 2 == 0) { str.insert(str.begin(), '0'); } else { str.insert(str.begin(), '1'); } a >>= 1; } return str; } int main() { string n; cin >> n; string a; for (unsigned int i = 0; i < n.length(); i++) { if (n[i] == 'm') { if (i == n.length() - 1) { a.push_back('0'); } else { if (n[i + 1] == 'u') { a.push_back('1'); } else { a.push_back('0'); } } } } unsigned int temp = BinToUInt(a); temp *= 2; string result = UIntToBin(temp); string ans; for (unsigned int i = 0; i < result.length(); i++) { ans = ans + "ham"; if (result[i] == '1') { ans.push_back('u'); } } cout << ans << endl; return 0; }