#include using namespace std; #define REP(i,n) for(int i=0;i ostream& operator<<(ostream& os,const vector& vec){ os << "["; for(const auto& v : vec){ os << v << ","; } os << "]"; return os; } typedef long long ll; typedef unsigned long long ull; typedef pair pii; typedef vector vi; typedef vector vvi; int main(){ string n; cin>>n; int N=n.size(); vi ans; while(n.size()){ if(n.substr(0,4)=="hamu"){ ans.push_back(1); n = n.substr(4); }else{ ans.push_back(0); n = n.substr(3); } } if(ans.size()==1 and ans[0]==0){ cout << "ham" << endl; return 0; } ans.push_back(0); bool f=false; for(int i=0;i