-- 間違ったやり方 power :: Integer -> Integer -> Integer power _ 0 = 1 power n 1 = n power n x | odd x = n * z * z | otherwise = z * z where z = power n (x `div` 2) main :: IO () main = do [a, x, b, y, c, z] <- map (read :: String -> Integer) . words <$> getLine let d = power a x + power b y + power c z putStrLn $ if even d then ":-)" else ":-("