#include<stdio.h>

int main(){
    char s[200000];
    int i, sum = 0;
    scanf("%s", s);
    for(i=0; s[i+1] != '\0'; i++){
        switch(s[i+1]){
            case '?':
                if(s[i] == 'P'){ //P?
                    sum += 2;
                    s[i+1] = 'D';
                }
                else if(s[i] == 'D'){ //D?
                    sum += 2;
                    s[i+1] = 'D';
                }
                else{
                    sum += 2; //??
                    s[i+1] = 'D';
                }
                break;
            case 'P': //PP, DP, ?P
                if(s[i] == '?') s[i] = 'D';
                break;
            case 'D':
                if(s[i] == 'P'){ //PD
                    sum += 1;
                }
                else if(s[i] == 'D'){ //DD
                    sum += 2; 
                }
                else{
                    sum += 2; //?D
                    s[i] = 'P';
                }
                break;
        }
    }
    for (i = 0; s[i] != '\0'; i++){
        printf("%c", s[i]);
    }
    //printf("%d", sum);
    return 0;
}