#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <fstream>
#include <string>
#include <stdio.h>
#include <vector>
#include <algorithm>
#include <map>
#include <bitset>
#include <stack>
#include <queue>
using namespace std;
#define len(n) (int)n.length()
#define dump cout
#define pb push_back
#define ll long long
#define make_pair mkp
   
int main()
{
    ios::sync_with_stdio(false);
    string ham;
    cin >> ham;
    cout << (ham == "ham" ? "ham" : ham + "ham") << endl;
    return 0;
}