main :: IO ()
main = solve <$> getLine >>= putStrLn

solve :: String -> String
solve xs | xs == "ham" = "ham"
         | otherwise = xs ++ "ham"