#include <bits/stdc++.h>
using namespace std;

int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);  
	
	string s; cin >> s;
	if(s == "ham") cout << s << endl;
	else	cout << s + "ham" << endl;	
	return 0;	
}