import Data.List (elem) main :: IO () main = do n <- readLn :: IO Integer m <- readLn :: IO Integer putStrLn $ if m `mod` 2 /= 0 && m `mod` 5 /= 0 then "-1" else [head $ dropWhile (\c -> c=='0'||c=='.') $ dropExp $ reverse $ show $ fromIntegral n/fromIntegral m] dropExp :: String -> String dropExp s | 'e' `elem` s = tail $ dropWhile (/='e') s | otherwise = s