import Data.Char main = getLine >> interact (unlines . map levelup . lines) levelup s = reverse $ st ++ reverse (plus1 n) ++ dropWhile isDigit sh where (st,sh) = span (not.isDigit) $ reverse s n = reverse $ takeWhile isDigit sh plus1 [] = [] plus1 n@(d:ds) | all (=='0') n = tail n ++ "1" | d=='0' = fill0 (length n) $ succ ((read::String->Int) n) | otherwise = show $ succ ((read::String->Int) n) fill0 n x = reverse $ take n $ reverse $ ((replicate n '0') ++) $ show x