     program main

    character T*200000
    integer S,I
    read *,T
    S = len_trim(T)
    I = S
    do
        if ( I == S ) then
            if ( T(I:I) == "?" ) then
                T(I:I) = "D"
            end if
        else
            if ( T(I:I) == "?" ) then
                if( I == 1 ) then
                    if( T(I+1:I+1) == "D") then
                        T(I:I) = "P"
                    else
                        T(I:I) = "D"
                    end if
                elseif( T(I-1:I-1) == "P" ) then
                    T(I:I) = "D"
                elseif( T(I+1:I+1) == "D") then
                    T(I:I) = "P"
                else
                    T(I:I) = "D"
                end if
            end if
        end if
        I = I - 1
        
        if ( I == 0 ) then
            exit
        end if

    end do
    
    print "(A)",trim(T)
    end program main