import java.util.Scanner;

public class Main {

	static Scanner sc = new Scanner(System.in);

	public static void main(String[] args) {
		String str = sc.next();
		System.out.println(str.equals("ham") ? str : str + "ham");
	}

}