#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define fi first #define se second #define rep(i,n) for(int i = 0; i < (n); ++i) #define rrep(i,n) for(int i = 1; i <= (n); ++i) #define drep(i,n) for(int i = (n)-1; i >= 0; --i) #define gep(i,g,j) for(int i = g.head[j]; i != -1; i = g.e[i].next) #define each(it,c) for(__typeof((c).begin()) it=(c).begin();it!=(c).end();it++) #define rng(a) a.begin(),a.end() #define maxs(x,y) x = max(x,y) #define mins(x,y) x = min(x,y) #define pb push_back #define sz(x) (int)(x).size() #define pcnt __builtin_popcount #define uni(x) x.erase(unique(rng(x)),x.end()) #define snuke srand((unsigned)clock()+(unsigned)time(NULL)); #define df(x) int x = in() #define dame { puts("0"); return 0;} #define show(x) cout<<#x<<" = "<,greater > using namespace std; typedef long long int ll; typedef pair P; typedef vector vi; typedef vector vvi; typedef vector vl; typedef vector

vp; inline int in() { int x; scanf("%d",&x); return x;} inline void priv(vi a) { rep(i,sz(a)) printf("%d%c",a[i],i==sz(a)-1?'\n':' ');} templateistream& operator>>(istream&i,vector&v) {rep(j,sz(v))i>>v[j];return i;} templatestring join(vector&v) {stringstream s;rep(i,sz(v))s<<' '<ostream& operator<<(ostream&o,vector&v) {if(sz(v))o<istream& operator>>(istream&i,pair&v) {return i>>v.fi>>v.se;} templateostream& operator<<(ostream&o,pair&v) {return o<> s; s += 'x'; ll x = 0; for (int i = 0; i < sz(s);) { if (s[i+3] == 'u') { x = x*2+1; i += 4; } else { x *= 2; i += 3; if (s[i] == 'x') break; } } x += 1; vi a; while (x) { a.pb(x&1); x >>= 1; } string ans; drep(i,sz(a)) { ans += "ham"; if (a[i]) ans += 'u'; } cout<