main = getLine >> getContents >>= mapM_ putStrLn . map ((\(a:b:_) -> let t = b * logBase 10 a; z = floor t; w = 10 ** (t - (fromIntegral z)); x = floor w; y = floor (10 * w) `mod` 10 in (unwords . map show) [x, y, z] ) . (map read . words)) . lines