#include #include int main(){ char s[50]; scanf("%s",s); if(strlen(s)==3){ printf("ham\n"); return 0; } else{ printf("%sham\n",s); return 0; } }