main = getLine >> getContents >>= mapM_ (putStrLn . solve . map read . words) . lines solve :: [Double] -> String solve [a, b] = x : ' ' : y : ' ' : show z where w = b * log a / log 10.0 z = truncate w [x, y] = take 2 . show . truncate $ 10.0 * 10.0 ** (w - fromIntegral z)