#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define REP(i,n) for(int i = 0; n > i; i++) #define MOD 1000000007 #define Range(x,a,b) ((a) <= (x) && (x) <= (b)) #define POWT(x) ((x)*(x)) using namespace std; typedef vector Ivec; typedef pair pii; typedef long long int ll; int main() { char str[51]; scanf("%s",str); int num = 0; int cou = 0; for(int i = 3; strlen(str) > i; i+=4) { if (str[i] == 'h'){ i--; } cou++; } int c = 0; for (int i = 3; strlen(str) > i; i += 4) { if (str[i] == 'u') { num |= 1 << cou-c-1; } else { i--; } c++; } num *= 2; string ans; while (num) { if (num & 1) { ans = "hamu" + ans; } else ans = "ham" + ans; num >>= 1; } if (ans == "") printf("ham\n"); cout << ans << endl; return 0; }