#define _USE_MATH_DEFINES #include <iostream> //cin, cout #include <vector> //vector #include <algorithm> //sort,min,max,count #include <string> //string,getline, to_string #include <cstdlib> //abs(int) #include <utility> //swap, pair #include <deque> //deque #include <climits> //INT_MAX #include <bitset> //bitset #include <cmath> //sqrt, ceil. M_PI, pow, sin #include <ios> //fixed #include <iomanip> //setprecision #include <sstream> //stringstream #include <numeric> //gcd, assumlate #include <random> //randam_device #include <limits> //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; }