#include<iostream>
#include<string>
#include<algorithm>
#include<cmath>
#include<iomanip>
#include<cstring>
#include<map>
#include<vector>
#include<queue>
#include<climits>
using namespace std;
typedef long long int ll;

int main(){

	char s[100];
	cin >> s;

	if(strlen(s)==3){
		cout << s << endl;
	} else {
		cout << s << "ham" << endl;
	}
  
  return 0;
}