import Control.Applicative import Control.Monad import Data.List.Split (splitOn) main :: IO () main = do n <- readLn solve <$> replicateM n getLine >>= prt solve :: [String] -> Integer solve ss = sum . map f $ ss where f s = case splitOn "." s of [a] -> read a * 10 ^ 10 [a, b] -> let ib = read (b ++ replicate (10 - length b) '0') in if head a == '-' then negate (10 ^ 10 * read (tail a) + ib) else 10 ^ 10 * read a + ib prt :: Integer -> IO () prt x = putStrLn $ sgn ++ a ++ "." ++ b where sgn = if x >= 0 then "" else "-" sx = if x >= 0 then show x else show (negate x) l = length sx (a, b) = if l > 10 then splitAt (l - 10) sx else splitAt 1 (replicate (11 - l) '0' ++ sx)