check :: String -> Int
check []           = 0
check [x]          = 0
check ('P':'D':cs) = 1 + check ('D':cs)
check ('D':cs)     = 1 + check cs
check (x:xs)       = check xs


main :: IO ()
main = do
  str <- getLine
  putStrLn $ map (\x -> if x == '?' then 'D' else x) str
