#include <bits/stdc++.h>
using namespace std;
string s;
int main() {
	cin >> s;
	cout << (s.size() >= 4 ? s + "ham" : s) << endl;
	return 0;
}