import java.util.Scanner; public class Main { public static void main(String[] p) { Scanner q = new Scanner(System.in); String str = q.next(); System.out.println(str.length() == 3 ? str : str + "ham"); } }